Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6X] pg_dump: set check constraints #14679

Merged
merged 2 commits into from Jan 11, 2023

Conversation

kalensk
Copy link
Contributor

@kalensk kalensk commented Dec 20, 2022

Commit a452dba introduced a regression that removed setting nchecks on tblinfo which are the number of check constraints. Since it was never set it defaulted to zero causing no table check constraints to be dumped.

This issue was discovered by the gpupgrade upgradeable pg_upgrade acceptance tests.

Test Pipeline: https://cm.ci.gpdb.pivotal.io/teams/main/pipelines/dumpCheckConstraints

Commit a452dba introduced a regression that removed setting nchecks on
tblinfo which are the number of check constraints. Since it was never
set it defaulted to zero causing no table check constraints to be
dumped.

This issue was discovered by the gpupgrade upgradeable pg_upgrade
acceptance tests.

Co-authored-by: Kevin Yeap <kyeap@vmware.com>
Co-authored-by: Jimmy Yih <jyih@vmware.com>
@kalensk
Copy link
Contributor Author

kalensk commented Jan 10, 2023

Hmmm just noticed that icw_planner_centos6 is consistently failing (other icw jobs are fine) on the binary_swap test for pg_dumpall_current with:

--- \/tmp\/build\/e18b2f02\/gpdb_src\/src\/test\/binary_swap\/expected\/pg_dumpall_current\.out	2023-01-09 23:51:10.937248398 +0000
+++ \/tmp\/build\/e18b2f02\/gpdb_src\/src\/test\/binary_swap\/results\/pg_dumpall_current\.out	2023-01-09 23:51:10.937248398 +0000
@@ -1,4 +1,6 @@
 GP_IGNORE: formatted by atmsort.pm
 \! pg_dumpall -f dump_current.sql
+pg_dump: finding table check constraints
+pg_dump: finding table check constraints
 \! echo $?
 0

That line comes from pg_dump.c::getTableAttrs() which is guarded by the corresponding condition:

if (!dataOnly && checkoids->len > 2)

Will need to fix whatever is going on before merging.

Whenever pg_dump finds a table check constraint, it would output a
verbose message even when the verbose flag was not given. Recent
commit 5e26208 refactored a verbose output line but didn't
properly put it under the verbosity conditional. Add the verbosity
conditional check.

GPDB commit reference:
greenplum-db@5e26208
@kalensk kalensk merged commit eb28fda into greenplum-db:6X_STABLE Jan 11, 2023
@kalensk kalensk deleted the dumpCheckConstraints branch January 11, 2023 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants