File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414 { name , postgresql } :
1515 let
1616 commandName = "postgrest-with-${ name } " ;
17+ postgresqlConf = writeText "postgresql.conf" "
18+ listen_addresses = ''
19+ log_statement = all
20+ " ;
1721 in
1822 checkedShellScript
1923 {
7276 TZ=$PGTZ initdb --no-locale --encoding=UTF8 --nosync -U postgres --auth=trust \
7377 >> "$setuplog"
7478
79+ # Append our own config to the one initdb created to avoid replacing
80+ # default values created by the latter.
81+ cat ${ postgresqlConf } >> "$tmpdir/db/postgresql.conf"
82+
7583 log "Starting the database cluster..."
7684
7785 # Instead of listening on a local port, we will listen on a unix domain socket.
8088 # On MacOS, it's 104 chars
8189 # See: https://serverfault.com/questions/641347/check-if-a-path-exceeds-maximum-for-unix-domain-socket
8290
83- pg_ctl -l "$tmpdir/db.log" -w start -o "-F -c listen_addresses=\"\" -c hba_file=$HBA_FILE -k $PGHOST -c log_statement=\"all\" " \
91+ pg_ctl -l "$tmpdir/db.log" -w start -o "-F -c hba_file=$HBA_FILE -k $PGHOST " \
8492 >> "$setuplog"
8593
8694 log "Creating a minimally privileged $PGUSER connection role..."
106114 log "Starting replica on $replica_host"
107115
108116 # We set a low max_standby_streaming_delay to make the replication conflict fail faster in tests (otherwise it waits for the default 30s)
109- pg_ctl -D "$replica_dir" -l "$replica_dblog" -w start -o "-F -c listen_addresses=\"\" -c hba_file=$HBA_FILE -k $replica_host -c log_statement=\"all\" -c max_standby_streaming_delay=\"3s\" " \
117+ pg_ctl -D "$replica_dir" -l "$replica_dblog" -w start -o "-F -c hba_file=$HBA_FILE -k $replica_host -c max_standby_streaming_delay=\"3s\" " \
110118 >> "$setuplog"
111119
112120 >&2 echo "${ commandName } : Replica enabled. You can connect to it with: psql 'postgres:///$PGDATABASE?host=$replica_host' -U postgres"
You can’t perform that action at this time.
0 commit comments