diff options
author | Robert Haas <rhaas@postgresql.org> | 2010-01-22 16:40:19 +0000 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2010-01-22 16:40:19 +0000 |
commit | 76a47c0e7423891d4b4f0977312f46fec6c5c416 (patch) | |
tree | 8c9ad15f5c0bf5b2c129ec78fece1780eb430c0d /src/backend/parser | |
parent | 9ca0989037602d9835eec04c2a9b6016a7b55740 (diff) | |
download | postgresql-76a47c0e7423891d4b4f0977312f46fec6c5c416.tar.gz postgresql-76a47c0e7423891d4b4f0977312f46fec6c5c416.zip |
Replace ALTER TABLE ... SET STATISTICS DISTINCT with a more general mechanism.
Attributes can now have options, just as relations and tablespaces do, and
the reloptions code is used to parse, validate, and store them. For
simplicity and because these options are not performance critical, we store
them in a separate cache rather than the main relcache.
Thanks to Alex Hunsaker for the review.
Diffstat (limited to 'src/backend/parser')
-rw-r--r-- | src/backend/parser/gram.y | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index af26d808633..c81e8a38ec9 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.703 2010/01/06 05:31:13 itagaki Exp $ + * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.704 2010/01/22 16:40:18 rhaas Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -1645,13 +1645,22 @@ alter_table_cmd: n->def = (Node *) makeInteger($6); $$ = (Node *)n; } - /* ALTER TABLE <name> ALTER [COLUMN] <colname> SET STATISTICS DISTINCT <NumericOnly> */ - | ALTER opt_column ColId SET STATISTICS DISTINCT NumericOnly + /* ALTER TABLE <name> ALTER [COLUMN] <colname> SET ( column_parameter = value [, ... ] ) */ + | ALTER opt_column ColId SET reloptions { AlterTableCmd *n = makeNode(AlterTableCmd); - n->subtype = AT_SetDistinct; + n->subtype = AT_SetOptions; n->name = $3; - n->def = (Node *) $7; + n->def = (Node *) $5; + $$ = (Node *)n; + } + /* ALTER TABLE <name> ALTER [COLUMN] <colname> SET ( column_parameter = value [, ... ] ) */ + | ALTER opt_column ColId RESET reloptions + { + AlterTableCmd *n = makeNode(AlterTableCmd); + n->subtype = AT_ResetOptions; + n->name = $3; + n->def = (Node *) $5; $$ = (Node *)n; } /* ALTER TABLE <name> ALTER [COLUMN] <colname> SET STORAGE <storagemode> */ |