timescaledb/test/sql/utils/pg_dump_unprivileged.sh
Erik Nordström 21dc7b9f7b Make tests using pg_dump work for PG12
PostgreSQL 12 changed the log level in client tools, such as
`pg_dump`, which makes some of our tests fail due to different log
level labels.

This change filters and modifies the log level output of `pg_dump` in
earlier PostgreSQL versions to adopt the new PostgreSQL 12 format.
2020-04-14 23:12:15 +02:00

11 lines
376 B
Bash
Executable File

export PGOPTIONS
PGOPTIONS='--client-min-messages=warning'
# PG12 changed client logging so NOTICE messages are now warning.
# We adopt this also for older PG versions to make tests compatible.
${PG_BINDIR}/pg_dump -h ${PGHOST} -U dump_unprivileged dump_unprivileged 2>&1 > /dev/null | sed 's/NOTICE/warning/g'
if [ $? -eq 0 ]; then
echo "Database dumped successfully"
fi