From de3e85c89386f714f3a4be0ce97bb35bb0c1cbc5 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Thu, 20 Feb 2025 00:35:14 +1100 Subject: [PATCH] Fixes to make postgres 17 work - WUBLOADER_USER now explicitly requires a grant on the public schema to create tables - `wal_keep_segments` renamed to `wal_keep_size` and is now a file size, not a number of segments - Remove some other config entries which did nothing or matched defaults --- postgres/setup.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/postgres/setup.sh b/postgres/setup.sh index 1454450..7c83644 100644 --- a/postgres/setup.sh +++ b/postgres/setup.sh @@ -1,6 +1,6 @@ #! /bin/bash -set -e +set -eu sql() { local user @@ -14,9 +14,10 @@ sed -i "/host all all all/d" "$PGDATA/pg_hba.conf" echo "host all $WUBLOADER_USER all md5" >> "$PGDATA/pg_hba.conf" echo "Creating $WUBLOADER_USER" -sql "$POSTGRES_USER" <<-EOSQL +sql "$POSTGRES_USER" -d "$POSTGRES_DB" <<-EOSQL CREATE USER $WUBLOADER_USER LOGIN PASSWORD '$WUBLOADER_PASSWORD'; +GRANT CREATE ON SCHEMA public TO $WUBLOADER_USER; EOSQL @@ -32,11 +33,7 @@ if [ -n "$REPLICATION_USER" ]; then EOSQL cat >> ${PGDATA}/postgresql.conf <<-EOF - wal_level = replica - archive_mode = on - archive_command = 'cd .' - max_wal_senders = 8 - wal_keep_segments = 8 + wal_keep_size = 128MB EOF fi