From: | amul sul <sul_amul(at)yahoo(dot)co(dot)in> |
---|---|
To: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | small query, about skipping dump in dumpAttrDef |
Date: | 2015-12-15 05:16:42 |
Message-ID: | 668258220.1174908.1450156602511.JavaMail.yahoo@mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi All,
In dumpAttrDef() function we are skipping dump if table definition is not dumped(i.e. by checking
tbinfo->dobj.dump), its absolutely alright to do this.
But, in dumpConstraint() we doing same by checking constraint dump flag(coninfo->dobj.dump) instead of table dump flag(tbinfo->dobj.dump).
IMHO, for a code consistency we should use attribute dump flag(adinfo->dobj.dump) instead of table dump flag as shown below:
=================================================================================================
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 36863df..8ac0776 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -14479,8 +14479,8 @@ dumpAttrDef(Archive *fout, DumpOptions *dopt, AttrDefInfo *adinfo)
PQExpBuffer q;
PQExpBuffer delq;
- /* Skip if table definition not to be dumped */
- if (!tbinfo->dobj.dump || dopt->dataOnly)
+ /* Skip if not to be dumped */
+ if (!adinfo->dobj.dump || dopt->dataOnly)
return;
/* Skip if not "separate"; it was dumped in the table's definition */
=================================================================================================
Comments? Thoughts?
Regards,
Amul Sul
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2015-12-15 05:19:26 | Re: Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename |
Previous Message | Tom Lane | 2015-12-15 05:05:26 | Re: Unused(?) field Form_pg_sequence.sequence_name, not updated by seq rename |