From 46b773d4fe0f0c880a1073cb5366efa02efa8ef8 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 28 Jul 2016 13:26:58 -0400 Subject: Improve documentation about CREATE TABLE ... LIKE. The docs failed to explain that LIKE INCLUDING INDEXES would not preserve the names of indexes and associated constraints. Also, it wasn't mentioned that EXCLUDE constraints would be copied by this option. The latter oversight seems enough of a documentation bug to justify back-patching. In passing, do some minor copy-editing in the same area, and add an entry for LIKE under "Compatibility", since it's not exactly a faithful implementation of the standard's feature. Discussion: <20160728151154.AABE64016B@smtp.hushmail.com> --- src/backend/parser/parse_utilcmd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/backend/parser/parse_utilcmd.c') diff --git a/src/backend/parser/parse_utilcmd.c b/src/backend/parser/parse_utilcmd.c index 6313087174d..e98fad051e4 100644 --- a/src/backend/parser/parse_utilcmd.c +++ b/src/backend/parser/parse_utilcmd.c @@ -1143,7 +1143,9 @@ generateClonedIndexStmt(CreateStmtContext *cxt, Relation source_idx, /* * We don't try to preserve the name of the source index; instead, just - * let DefineIndex() choose a reasonable name. + * let DefineIndex() choose a reasonable name. (If we tried to preserve + * the name, we'd get duplicate-relation-name failures unless the source + * table was in a different schema.) */ index->idxname = NULL; -- cgit v1.2.3