summaryrefslogtreecommitdiff
path: root/src/backend/commands/statscmds.c
diff options
context:
space:
mode:
authorDean Rasheed2022-07-21 18:23:13 +0000
committerDean Rasheed2022-07-21 18:23:13 +0000
commit624aa2a13bd02dd584bb0995c883b5b93b2152df (patch)
tree9fb20bf9030cd894df4dcf55665a5b51fb0f85b4 /src/backend/commands/statscmds.c
parentfa6c230ef23cfe5367cb883fd461580f6a42619d (diff)
Make the name optional in CREATE STATISTICS.
This allows users to omit the statistics name in a CREATE STATISTICS command, letting the system auto-generate a sensible, unique name, putting the statistics object in the same schema as the table. Simon Riggs, reviewed by Matthias van de Meent. Discussion: https://postgr.es/m/CANbhV-FGD2d_C3zFTfT2aRfX_TaPSgOeKES58RLZx5XzQp5NhA@mail.gmail.com
Diffstat (limited to 'src/backend/commands/statscmds.c')
-rw-r--r--src/backend/commands/statscmds.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/commands/statscmds.c b/src/backend/commands/statscmds.c
index cd5e2f2b6b0..415016969dd 100644
--- a/src/backend/commands/statscmds.c
+++ b/src/backend/commands/statscmds.c
@@ -155,10 +155,9 @@ CreateStatistics(CreateStatsStmt *stmt)
/*
* If the node has a name, split it up and determine creation namespace.
- * If not (a possibility not considered by the grammar, but one which can
- * occur via the "CREATE TABLE ... (LIKE)" command), then we put the
- * object in the same namespace as the relation, and cons up a name for
- * it.
+ * If not, put the object in the same namespace as the relation, and cons
+ * up a name for it. (This can happen either via "CREATE STATISTICS ..."
+ * or via "CREATE TABLE ... (LIKE)".)
*/
if (stmt->defnames)
namespaceId = QualifiedNameGetCreationNamespace(stmt->defnames,