summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorStephen Frost2017-04-28 00:14:39 +0000
committerStephen Frost2017-04-28 00:14:39 +0000
commitb9a3ef55b253d885081c2d0e9dc45802cab71c7b (patch)
tree7ac94e2b90d2b8269a3b826300e8d5d51d7ff7d3 /src/bin
parentab9c43381ef7a7333086107847413e0b593854d0 (diff)
Remove unnecessairly duplicated gram.y productions
Declarative partitioning duplicated the TypedTableElement productions, evidently to remove the need to specify WITH OPTIONS when creating partitions. Instead, simply make WITH OPTIONS optional in the TypedTableElement production and remove all of the duplicate PartitionElement-related productions. This change simplifies the syntax and makes WITH OPTIONS optional when adding defaults, constraints or storage parameters to columns when creating either typed tables or partitions. Also update pg_dump to no longer include WITH OPTIONS, since it's not necessary, and update the documentation to reflect that WITH OPTIONS is now optional.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/pg_dump/pg_dump.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index e9b5c8a4483..2fda350faa2 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -15267,13 +15267,16 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
continue;
}
- /* Attribute type */
- if ((tbinfo->reloftype || tbinfo->partitionOf) &&
- !dopt->binary_upgrade)
- {
- appendPQExpBufferStr(q, " WITH OPTIONS");
- }
- else
+ /*
+ * Attribute type
+ *
+ * In binary-upgrade mode, we always include the type.
+ * If we aren't in binary-upgrade mode, then we skip the
+ * type when creating a typed table ('OF type_name') or a
+ * partition ('PARTITION OF'), since the type comes from
+ * the parent/partitioned table.
+ */
+ if (dopt->binary_upgrade || (!tbinfo->reloftype && !tbinfo->partitionOf))
{
appendPQExpBuffer(q, " %s",
tbinfo->atttypnames[j]);