mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
DDL support for collations
- collowner field - CREATE COLLATION - ALTER COLLATION - DROP COLLATION - COMMENT ON COLLATION - integration with extensions - pg_dump support for the above - dependency management - psql tab completion - psql \dO command
This commit is contained in:
@ -482,7 +482,7 @@ static RangeVar *makeRangeVarFromAnyName(List *names, int position, core_yyscan_
|
||||
|
||||
CACHE CALLED CASCADE CASCADED CASE CAST CATALOG_P CHAIN CHAR_P
|
||||
CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE
|
||||
CLUSTER COALESCE COLLATE COLUMN COMMENT COMMENTS COMMIT
|
||||
CLUSTER COALESCE COLLATE COLLATION COLUMN COMMENT COMMENTS COMMIT
|
||||
COMMITTED CONCURRENTLY CONFIGURATION CONNECTION CONSTRAINT CONSTRAINTS
|
||||
CONTENT_P CONTINUE_P CONVERSION_P COPY COST CREATE CREATEDB
|
||||
CREATEROLE CREATEUSER CROSS CSV CURRENT_P
|
||||
@ -3316,6 +3316,15 @@ AlterExtensionContentsStmt:
|
||||
n->objargs = list_make1($9);
|
||||
$$ = (Node *) n;
|
||||
}
|
||||
| ALTER EXTENSION name add_drop COLLATION any_name
|
||||
{
|
||||
AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
|
||||
n->extname = $3;
|
||||
n->action = $4;
|
||||
n->objtype = OBJECT_COLLATION;
|
||||
n->objname = $6;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| ALTER EXTENSION name add_drop CONVERSION_P any_name
|
||||
{
|
||||
AlterExtensionContentsStmt *n = makeNode(AlterExtensionContentsStmt);
|
||||
@ -4248,6 +4257,24 @@ DefineStmt:
|
||||
n->definition = $6;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| CREATE COLLATION any_name definition
|
||||
{
|
||||
DefineStmt *n = makeNode(DefineStmt);
|
||||
n->kind = OBJECT_COLLATION;
|
||||
n->args = NIL;
|
||||
n->defnames = $3;
|
||||
n->definition = $4;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| CREATE COLLATION any_name FROM any_name
|
||||
{
|
||||
DefineStmt *n = makeNode(DefineStmt);
|
||||
n->kind = OBJECT_COLLATION;
|
||||
n->args = NIL;
|
||||
n->defnames = $3;
|
||||
n->definition = list_make1(makeDefElem("from", (Node *) $5));
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
;
|
||||
|
||||
definition: '(' def_list ')' { $$ = $2; }
|
||||
@ -4621,6 +4648,7 @@ drop_type: TABLE { $$ = OBJECT_TABLE; }
|
||||
| FOREIGN TABLE { $$ = OBJECT_FOREIGN_TABLE; }
|
||||
| TYPE_P { $$ = OBJECT_TYPE; }
|
||||
| DOMAIN_P { $$ = OBJECT_DOMAIN; }
|
||||
| COLLATION { $$ = OBJECT_COLLATION; }
|
||||
| CONVERSION_P { $$ = OBJECT_CONVERSION; }
|
||||
| SCHEMA { $$ = OBJECT_SCHEMA; }
|
||||
| EXTENSION { $$ = OBJECT_EXTENSION; }
|
||||
@ -4676,7 +4704,7 @@ opt_restart_seqs:
|
||||
* the object associated with the comment. The form of the statement is:
|
||||
*
|
||||
* COMMENT ON [ [ DATABASE | DOMAIN | INDEX | SEQUENCE | TABLE | TYPE | VIEW |
|
||||
* CONVERSION | LANGUAGE | OPERATOR CLASS | LARGE OBJECT |
|
||||
* COLLATION | CONVERSION | LANGUAGE | OPERATOR CLASS | LARGE OBJECT |
|
||||
* CAST | COLUMN | SCHEMA | TABLESPACE | EXTENSION | ROLE |
|
||||
* TEXT SEARCH PARSER | TEXT SEARCH DICTIONARY |
|
||||
* TEXT SEARCH TEMPLATE | TEXT SEARCH CONFIGURATION |
|
||||
@ -4854,6 +4882,7 @@ comment_type:
|
||||
| DOMAIN_P { $$ = OBJECT_DOMAIN; }
|
||||
| TYPE_P { $$ = OBJECT_TYPE; }
|
||||
| VIEW { $$ = OBJECT_VIEW; }
|
||||
| COLLATION { $$ = OBJECT_COLLATION; }
|
||||
| CONVERSION_P { $$ = OBJECT_CONVERSION; }
|
||||
| TABLESPACE { $$ = OBJECT_TABLESPACE; }
|
||||
| EXTENSION { $$ = OBJECT_EXTENSION; }
|
||||
@ -6275,6 +6304,14 @@ RenameStmt: ALTER AGGREGATE func_name aggr_args RENAME TO name
|
||||
n->newname = $7;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| ALTER COLLATION any_name RENAME TO name
|
||||
{
|
||||
RenameStmt *n = makeNode(RenameStmt);
|
||||
n->renameType = OBJECT_COLLATION;
|
||||
n->object = $3;
|
||||
n->newname = $6;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| ALTER CONVERSION_P any_name RENAME TO name
|
||||
{
|
||||
RenameStmt *n = makeNode(RenameStmt);
|
||||
@ -6535,6 +6572,14 @@ AlterObjectSchemaStmt:
|
||||
n->newschema = $7;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| ALTER COLLATION any_name SET SCHEMA name
|
||||
{
|
||||
AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
|
||||
n->objectType = OBJECT_COLLATION;
|
||||
n->object = $3;
|
||||
n->newschema = $6;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| ALTER CONVERSION_P any_name SET SCHEMA name
|
||||
{
|
||||
AlterObjectSchemaStmt *n = makeNode(AlterObjectSchemaStmt);
|
||||
@ -6684,6 +6729,14 @@ AlterOwnerStmt: ALTER AGGREGATE func_name aggr_args OWNER TO RoleId
|
||||
n->newowner = $7;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| ALTER COLLATION any_name OWNER TO RoleId
|
||||
{
|
||||
AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
|
||||
n->objectType = OBJECT_COLLATION;
|
||||
n->object = $3;
|
||||
n->newowner = $6;
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
| ALTER CONVERSION_P any_name OWNER TO RoleId
|
||||
{
|
||||
AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
|
||||
|
Reference in New Issue
Block a user