Skip to content

Commit

Permalink
Fix wal_level for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bonnefoa committed May 11, 2023
1 parent 55332e4 commit 9a682c0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions postgres/tests/compose/resources/02_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" dogs_nofunc <<-'EOSQL'
DROP FUNCTION datadog.explain_statement(l_query text, out explain JSON)
EOSQL

# Somehow, on old postgres version (11 and 12), wal_level is incorrectly set despite
# being present in postgresql.conf. Alter and restart to make sure we have the correct wal_level.
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" datadog_test <<-'EOSQL'
ALTER SYSTEM SET wal_level = logical;
EOSQL
pg_ctl -D /var/lib/postgresql/data -w restart

psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" datadog_test <<-'EOSQL'
SELECT * FROM pg_create_physical_replication_slot('replication_slot');
SELECT * FROM pg_create_logical_replication_slot('logical_slot', 'test_decoding');
Expand Down

0 comments on commit 9a682c0

Please sign in to comment.