@@ -60,28 +60,28 @@ pub use self::dcl::{
6060 SetConfigValue , Use ,
6161} ;
6262pub use self :: ddl:: {
63- Alignment , AlterColumnOperation , AlterConnectorOwner , AlterFunction , AlterFunctionAction ,
64- AlterFunctionKind , AlterFunctionOperation , AlterIndexOperation , AlterOperator ,
65- AlterOperatorClass , AlterOperatorClassOperation , AlterOperatorFamily ,
66- AlterOperatorFamilyOperation , AlterOperatorOperation , AlterPolicy , AlterPolicyOperation ,
67- AlterSchema , AlterSchemaOperation , AlterTable , AlterTableAlgorithm , AlterTableLock ,
68- AlterTableOperation , AlterTableType , AlterType , AlterTypeAddValue , AlterTypeAddValuePosition ,
69- AlterTypeOperation , AlterTypeRename , AlterTypeRenameValue , ClusteredBy , ColumnDef ,
70- ColumnOption , ColumnOptionDef , ColumnOptions , ColumnPolicy , ColumnPolicyProperty ,
71- ConstraintCharacteristics , CreateConnector , CreateDomain , CreateExtension , CreateFunction ,
72- CreateIndex , CreateOperator , CreateOperatorClass , CreateOperatorFamily , CreatePolicy ,
73- CreatePolicyCommand , CreatePolicyType , CreateTable , CreateTrigger , CreateView , Deduplicate ,
74- DeferrableInitial , DistStyle , DropBehavior , DropExtension , DropFunction , DropOperator ,
75- DropOperatorClass , DropOperatorFamily , DropOperatorSignature , DropPolicy , DropTrigger ,
76- ForValues , FunctionReturnType , GeneratedAs , GeneratedExpressionMode , IdentityParameters ,
77- IdentityProperty , IdentityPropertyFormatKind , IdentityPropertyKind , IdentityPropertyOrder ,
78- IndexColumn , IndexOption , IndexType , KeyOrIndexDisplay , Msck , NullsDistinctOption ,
79- OperatorArgTypes , OperatorClassItem , OperatorFamilyDropItem , OperatorFamilyItem ,
80- OperatorOption , OperatorPurpose , Owner , Partition , PartitionBoundValue , ProcedureParam ,
81- ReferentialAction , RenameTableNameKind , ReplicaIdentity , TagsColumnOption , TriggerObjectKind ,
82- Truncate , UserDefinedTypeCompositeAttributeDef , UserDefinedTypeInternalLength ,
83- UserDefinedTypeRangeOption , UserDefinedTypeRepresentation , UserDefinedTypeSqlDefinitionOption ,
84- UserDefinedTypeStorage , ViewColumnDef ,
63+ Alignment , AlterCollation , AlterCollationOperation , AlterColumnOperation , AlterConnectorOwner ,
64+ AlterFunction , AlterFunctionAction , AlterFunctionKind , AlterFunctionOperation ,
65+ AlterIndexOperation , AlterOperator , AlterOperatorClass , AlterOperatorClassOperation ,
66+ AlterOperatorFamily , AlterOperatorFamilyOperation , AlterOperatorOperation , AlterPolicy ,
67+ AlterPolicyOperation , AlterSchema , AlterSchemaOperation , AlterTable , AlterTableAlgorithm ,
68+ AlterTableLock , AlterTableOperation , AlterTableType , AlterType , AlterTypeAddValue ,
69+ AlterTypeAddValuePosition , AlterTypeOperation , AlterTypeRename , AlterTypeRenameValue ,
70+ ClusteredBy , ColumnDef , ColumnOption , ColumnOptionDef , ColumnOptions , ColumnPolicy ,
71+ ColumnPolicyProperty , ConstraintCharacteristics , CreateCollation , CreateCollationDefinition ,
72+ CreateConnector , CreateDomain , CreateExtension , CreateFunction , CreateIndex , CreateOperator ,
73+ CreateOperatorClass , CreateOperatorFamily , CreatePolicy , CreatePolicyCommand , CreatePolicyType ,
74+ CreateTable , CreateTrigger , CreateView , Deduplicate , DeferrableInitial , DistStyle ,
75+ DropBehavior , DropExtension , DropFunction , DropOperator , DropOperatorClass , DropOperatorFamily ,
76+ DropOperatorSignature , DropPolicy , DropTrigger , ForValues , FunctionReturnType , GeneratedAs ,
77+ GeneratedExpressionMode , IdentityParameters , IdentityProperty , IdentityPropertyFormatKind ,
78+ IdentityPropertyKind , IdentityPropertyOrder , IndexColumn , IndexOption , IndexType ,
79+ KeyOrIndexDisplay , Msck , NullsDistinctOption , OperatorArgTypes , OperatorClassItem ,
80+ OperatorFamilyDropItem , OperatorFamilyItem , OperatorOption , OperatorPurpose , Owner , Partition ,
81+ PartitionBoundValue , ProcedureParam , ReferentialAction , RenameTableNameKind , ReplicaIdentity ,
82+ TagsColumnOption , TriggerObjectKind , Truncate , UserDefinedTypeCompositeAttributeDef ,
83+ UserDefinedTypeInternalLength , UserDefinedTypeRangeOption , UserDefinedTypeRepresentation ,
84+ UserDefinedTypeSqlDefinitionOption , UserDefinedTypeStorage , ViewColumnDef ,
8585} ;
8686pub use self :: dml:: {
8787 Delete , Insert , Merge , MergeAction , MergeClause , MergeClauseKind , MergeInsertExpr ,
@@ -2450,6 +2450,8 @@ impl fmt::Display for ShowCreateObject {
24502450#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
24512451/// Objects that can be targeted by a `COMMENT` statement.
24522452pub enum CommentObject {
2453+ /// A collation.
2454+ Collation ,
24532455 /// A table column.
24542456 Column ,
24552457 /// A database.
@@ -2485,6 +2487,7 @@ pub enum CommentObject {
24852487impl fmt:: Display for CommentObject {
24862488 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
24872489 match self {
2490+ CommentObject :: Collation => f. write_str ( "COLLATION" ) ,
24882491 CommentObject :: Column => f. write_str ( "COLUMN" ) ,
24892492 CommentObject :: Database => f. write_str ( "DATABASE" ) ,
24902493 CommentObject :: Domain => f. write_str ( "DOMAIN" ) ,
@@ -3764,6 +3767,11 @@ pub enum Statement {
37643767 /// ```
37653768 AlterType ( AlterType ) ,
37663769 /// ```sql
3770+ /// ALTER COLLATION
3771+ /// ```
3772+ /// See [PostgreSQL](https://www.postgresql.org/docs/current/sql-altercollation.html)
3773+ AlterCollation ( AlterCollation ) ,
3774+ /// ```sql
37673775 /// ALTER OPERATOR
37683776 /// ```
37693777 /// See [PostgreSQL](https://www.postgresql.org/docs/current/sql-alteroperator.html)
@@ -3960,6 +3968,12 @@ pub enum Statement {
39603968 /// Note: this is a PostgreSQL-specific statement,
39613969 CreateExtension ( CreateExtension ) ,
39623970 /// ```sql
3971+ /// CREATE COLLATION
3972+ /// ```
3973+ /// Note: this is a PostgreSQL-specific statement.
3974+ /// <https://www.postgresql.org/docs/current/sql-createcollation.html>
3975+ CreateCollation ( CreateCollation ) ,
3976+ /// ```sql
39633977 /// DROP EXTENSION [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
39643978 /// ```
39653979 /// Note: this is a PostgreSQL-specific statement.
@@ -5430,6 +5444,7 @@ impl fmt::Display for Statement {
54305444 }
54315445 Statement :: CreateIndex ( create_index) => create_index. fmt ( f) ,
54325446 Statement :: CreateExtension ( create_extension) => write ! ( f, "{create_extension}" ) ,
5447+ Statement :: CreateCollation ( create_collation) => write ! ( f, "{create_collation}" ) ,
54335448 Statement :: DropExtension ( drop_extension) => write ! ( f, "{drop_extension}" ) ,
54345449 Statement :: DropOperator ( drop_operator) => write ! ( f, "{drop_operator}" ) ,
54355450 Statement :: DropOperatorFamily ( drop_operator_family) => {
@@ -5507,6 +5522,7 @@ impl fmt::Display for Statement {
55075522 Statement :: AlterType ( AlterType { name, operation } ) => {
55085523 write ! ( f, "ALTER TYPE {name} {operation}" )
55095524 }
5525+ Statement :: AlterCollation ( alter_collation) => write ! ( f, "{alter_collation}" ) ,
55105526 Statement :: AlterOperator ( alter_operator) => write ! ( f, "{alter_operator}" ) ,
55115527 Statement :: AlterOperatorFamily ( alter_operator_family) => {
55125528 write ! ( f, "{alter_operator_family}" )
@@ -8380,6 +8396,8 @@ impl fmt::Display for HavingBoundKind {
83808396#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
83818397/// Types of database objects referenced by DDL statements.
83828398pub enum ObjectType {
8399+ /// A collation.
8400+ Collation ,
83838401 /// A table.
83848402 Table ,
83858403 /// A view.
@@ -8409,6 +8427,7 @@ pub enum ObjectType {
84098427impl fmt:: Display for ObjectType {
84108428 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
84118429 f. write_str ( match self {
8430+ ObjectType :: Collation => "COLLATION" ,
84128431 ObjectType :: Table => "TABLE" ,
84138432 ObjectType :: View => "VIEW" ,
84148433 ObjectType :: MaterializedView => "MATERIALIZED VIEW" ,
@@ -12011,6 +12030,12 @@ impl From<CreateExtension> for Statement {
1201112030 }
1201212031}
1201312032
12033+ impl From < CreateCollation > for Statement {
12034+ fn from ( c : CreateCollation ) -> Self {
12035+ Self :: CreateCollation ( c)
12036+ }
12037+ }
12038+
1201412039impl From < DropExtension > for Statement {
1201512040 fn from ( de : DropExtension ) -> Self {
1201612041 Self :: DropExtension ( de)
@@ -12125,6 +12150,12 @@ impl From<AlterType> for Statement {
1212512150 }
1212612151}
1212712152
12153+ impl From < AlterCollation > for Statement {
12154+ fn from ( a : AlterCollation ) -> Self {
12155+ Self :: AlterCollation ( a)
12156+ }
12157+ }
12158+
1212812159impl From < AlterOperator > for Statement {
1212912160 fn from ( a : AlterOperator ) -> Self {
1213012161 Self :: AlterOperator ( a)
0 commit comments