mirror of
https://github.com/postgres/postgres.git
synced 2025-08-22 21:53:06 +03:00
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
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user