Skip to content

Commit

Permalink
pg_dump on PG15 does not log messages with log level set to PG_LOG_INFO.
Browse files Browse the repository at this point in the history
Version 15 pg_dump program does not log any messages with log level <
PG_LOG_WARNING to stdout. Whereas this check is not present in version
14, thus we see corresponding tests fail with missing log information.
This patch fixes by supressing those log information, so that the tests
pass on all versions of postgresql.

Fixes #4832
  • Loading branch information
sb230132 committed Nov 1, 2022
1 parent 840f144 commit c06b647
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 86 deletions.
6 changes: 2 additions & 4 deletions .github/gh_matrix_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,9 @@ def macos_config(overrides):
"snapshot": "snapshot",
"tsdb_build_args": "-DASSERTIONS=ON -DREQUIRE_ALL_TESTS=ON -DEXPERIMENTAL=ON",
# below tests are tracked as part of #4838
"installcheck_args": "SKIPS='003_connections_privs 001_simple_multinode 004_multinode_rdwr_1pc data_node_bootstrap dist_hypertable-15 bgw_custom' "
# below tests are tracked as part of #4832
"IGNORES='pg_dump_unprivileged cagg_dump metadata pg_dump compression_hypertable "
"installcheck_args": "SKIPS='003_connections_privs 001_simple_multinode 004_multinode_rdwr_1pc data_node_bootstrap dist_hypertable-15 bgw_custom cagg_dump' "
# below tests are tracked as part of #4833
"telemetry_stats dist_commands dist_ddl dist_query dist_partial_agg continuous_aggs continuous_aggs_deprecated "
"IGNORES='telemetry_stats dist_commands dist_ddl dist_query dist_partial_agg continuous_aggs continuous_aggs_deprecated "
# below tests are tracked as part of #4834
"compression compression_dml modify_exclusion rowsecurity-15 "
# below tests are tracked as part of #4835
Expand Down
8 changes: 0 additions & 8 deletions test/expected/metadata.out
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,6 @@ SELECT _timescaledb_internal.test_install_timestamp() = :'timestamp_1' as timest
\c postgres :ROLE_SUPERUSER
\setenv PGOPTIONS '--client-min-messages=warning'
\! utils/pg_dump_aux_dump.sh dump/instmeta.sql
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
ALTER DATABASE :TEST_DBNAME SET timescaledb.restoring='on';
-- Redirect to /dev/null to suppress NOTICE
\! utils/pg_dump_aux_restore.sh dump/instmeta.sql
Expand Down
8 changes: 0 additions & 8 deletions test/expected/pg_dump.out
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,6 @@ INSERT INTO _timescaledb_catalog.metadata VALUES ('exported_uuid', 'original_uui
-- environmental variables that originally called this psql command. Sadly
-- vars passed to psql do not work in \! commands so we can't do it that way.
\! utils/pg_dump_aux_dump.sh dump/pg_dump.sql
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
\c :TEST_DBNAME
SET client_min_messages = ERROR;
CREATE EXTENSION timescaledb CASCADE;
Expand Down
8 changes: 0 additions & 8 deletions test/expected/pg_dump_unprivileged.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,6 @@ CREATE USER dump_unprivileged CREATEDB;
\c template1 dump_unprivileged
CREATE database dump_unprivileged;
\! utils/pg_dump_unprivileged.sh
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
Database dumped successfully
\c template1 :ROLE_SUPERUSER
DROP EXTENSION timescaledb;
Expand Down
2 changes: 1 addition & 1 deletion test/sql/utils/pg_dump_aux_dump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ export PGOPTIONS

# 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 ${TEST_ROLE_SUPERUSER} -Fc ${TEST_DBNAME} 2>&1 > ${DUMPFILE} | sed 's/NOTICE/warning/g'
${PG_BINDIR}/pg_dump -h ${PGHOST} -U ${TEST_ROLE_SUPERUSER} -Fc ${TEST_DBNAME} > /dev/null 2>&1 -f ${DUMPFILE} | sed 's/NOTICE/warning/g'
${PG_BINDIR}/dropdb -h ${PGHOST} -U ${TEST_ROLE_SUPERUSER} ${TEST_DBNAME}
${PG_BINDIR}/createdb -h ${PGHOST} -U ${TEST_ROLE_SUPERUSER} ${TEST_DBNAME}
2 changes: 1 addition & 1 deletion test/sql/utils/pg_dump_unprivileged.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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'
${PG_BINDIR}/pg_dump -h ${PGHOST} -U dump_unprivileged dump_unprivileged > /dev/null 2>&1 | sed 's/NOTICE/warning/g'

if [ $? -eq 0 ]; then
echo "Database dumped successfully"
Expand Down
8 changes: 0 additions & 8 deletions tsl/test/expected/cagg_dump.out
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,6 @@ SELECT count(*) FROM conditions_after;
--dump & restore
\c postgres :ROLE_SUPERUSER
\! utils/pg_dump_aux_dump.sh dump/pg_dump.sql
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
\c :TEST_DBNAME
SET client_min_messages = ERROR;
CREATE EXTENSION timescaledb CASCADE;
Expand Down
48 changes: 0 additions & 48 deletions tsl/test/expected/compression_hypertable.out
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,6 @@ psql:include/compression_test_hypertable.sql:7: NOTICE: table "original_result"
27
(1 row)

pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
timescaledb_pre_restore
-------------------------
t
Expand Down Expand Up @@ -229,14 +221,6 @@ SELECT 'test2' AS "HYPERTABLE_NAME" \gset
5
(1 row)

pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
timescaledb_pre_restore
-------------------------
t
Expand Down Expand Up @@ -349,14 +333,6 @@ SELECT 'test4' AS "HYPERTABLE_NAME" \gset
1
(1 row)

pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
timescaledb_pre_restore
-------------------------
t
Expand Down Expand Up @@ -470,14 +446,6 @@ SELECT 'test5' AS "HYPERTABLE_NAME" \gset
10
(1 row)

pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
timescaledb_pre_restore
-------------------------
t
Expand Down Expand Up @@ -558,14 +526,6 @@ INSERT INTO test6 SELECT t, NULL, customtype_in(t::TEXT::cstring)
5
(1 row)

pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
timescaledb_pre_restore
-------------------------
t
Expand Down Expand Up @@ -643,14 +603,6 @@ INSERT INTO test7
1
(1 row)

pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: hypertable
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
pg_dump: warning: there are circular foreign-key constraints on this table:
pg_dump: chunk
pg_dump: You might not be able to restore the dump without using --disable-triggers or temporarily dropping the constraints.
pg_dump: Consider using a full dump instead of a --data-only dump to avoid this problem.
timescaledb_pre_restore
-------------------------
t
Expand Down

0 comments on commit c06b647

Please sign in to comment.