File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change 1
1
# Job to create indexes on dbsync instance.
2
2
#
3
- # This is difficult to automatize because it has to be ran after the postgres is created
4
- # and dbsync has ran, but before anyone uses it. Here you have to replace the salt and the
5
- # network for it to work.
3
+ # This is difficult to automatize because it has to be ran after the postgres
4
+ # is created and dbsync has ran, but before anyone uses it. Here you have to
5
+ # replace the salt, pgbouncerpassword and the network for it to work.
6
6
---
7
7
apiVersion : v1
8
8
data :
9
9
indexes.sql : |
10
10
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
11
11
12
+ -- PGBouncer
13
+ CREATE ROLE pgbouncer WITH PASSWORD '{pgbouncerpassword}';
14
+ ALTER ROLE pgbouncer WITH LOGIN;
15
+ CREATE OR REPLACE FUNCTION user_search(uname TEXT) RETURNS TABLE (usename name, passwd text) as
16
+ $$
17
+ SELECT usename, passwd FROM pg_shadow WHERE usename=uname;
18
+ $$
19
+ LANGUAGE sql SECURITY DEFINER;
20
+
12
21
-- dbsync indexes
13
22
CREATE UNIQUE INDEX IF NOT EXISTS ada_pots_pkey ON public.ada_pots USING btree (id);
14
23
CREATE UNIQUE INDEX IF NOT EXISTS unique_ada_pots ON public.ada_pots USING btree (block_id);
@@ -202,6 +211,8 @@ data:
202
211
CREATE INDEX IF NOT EXISTS bf_idx_col_tx_out ON collateral_tx_out USING btree (tx_id);
203
212
CREATE INDEX IF NOT EXISTS bf_idx_ma_tx_mint_ident ON ma_tx_mint USING btree (ident);
204
213
CREATE INDEX IF NOT EXISTS bf_idx_ma_tx_out_ident ON ma_tx_out USING btree (ident);
214
+
215
+ ANALYZE VERBOSE;
205
216
immutable : false
206
217
kind : ConfigMap
207
218
metadata :
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
export PGSSLMODE=disable
3
3
export PG_SUPERUSER=postgres
4
- export PGPASSWORD=" "
4
+ export PGPASSWORD=" . "
5
5
export PG_NEW_USER=" "
6
6
export PG_NEW_USER_PASSWORD=" "
7
7
export PGHOST=localhost
@@ -15,7 +15,7 @@ if [ -z "$PG_SUPERUSER" ] || [ -z "$PGPASSWORD" ] || [ -z "$PG_NEW_USER" ] || [
15
15
fi
16
16
17
17
# Target databases
18
- databases=(" dbsync-mainnet" " dbsync-preview" " dbsync-preprod" )
18
+ databases=(" dbsync-mainnet" " dbsync-preview" " dbsync-preprod" " dbsync-vector-testnet " " dbsync-prime-testnet " )
19
19
20
20
# Create the new user
21
21
echo " Creating user: $PG_NEW_USER "
You can’t perform that action at this time.
0 commit comments