aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_dump.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 784bceaec39..34063888721 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -8644,9 +8644,10 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
PQclear(res);
/*
- * Get info about column defaults
+ * Get info about column defaults. This is skipped for a data-only
+ * dump, as it is only needed for table schemas.
*/
- if (hasdefaults)
+ if (!dopt->dataOnly && hasdefaults)
{
AttrDefInfo *attrdefs;
int numDefaults;
@@ -8731,9 +8732,10 @@ getTableAttrs(Archive *fout, TableInfo *tblinfo, int numTables)
}
/*
- * Get info about table CHECK constraints
+ * Get info about table CHECK constraints. This is skipped for a
+ * data-only dump, as it is only needed for table schemas.
*/
- if (tbinfo->ncheck > 0)
+ if (!dopt->dataOnly && tbinfo->ncheck > 0)
{
ConstraintInfo *constrs;
int numConstrs;