@@ -60,26 +60,27 @@ 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 , AlterTextSearch , AlterTextSearchDictionaryOption ,
69- AlterTextSearchOperation , AlterType , AlterTypeAddValue , AlterTypeAddValuePosition ,
70- AlterTypeOperation , AlterTypeRename , AlterTypeRenameValue , ClusteredBy , ColumnDef ,
71- ColumnOption , ColumnOptionDef , ColumnOptions , ColumnPolicy , ColumnPolicyProperty ,
72- ConstraintCharacteristics , CreateConnector , CreateDomain , CreateExtension , CreateFunction ,
73- CreateIndex , CreateOperator , CreateOperatorClass , CreateOperatorFamily , CreatePolicy ,
74- CreatePolicyCommand , CreatePolicyType , CreateTable , CreateTextSearch , CreateTrigger ,
75- CreateView , Deduplicate , DeferrableInitial , DistStyle , DropBehavior , DropExtension ,
76- DropFunction , DropOperator , DropOperatorClass , DropOperatorFamily , DropOperatorSignature ,
77- DropPolicy , DropTrigger , ForValues , FunctionReturnType , GeneratedAs , GeneratedExpressionMode ,
78- IdentityParameters , IdentityProperty , IdentityPropertyFormatKind , IdentityPropertyKind ,
79- IdentityPropertyOrder , IndexColumn , IndexOption , IndexType , KeyOrIndexDisplay , Msck ,
80- NullsDistinctOption , OperatorArgTypes , OperatorClassItem , OperatorFamilyDropItem ,
81- OperatorFamilyItem , OperatorOption , OperatorPurpose , Owner , Partition , PartitionBoundValue ,
82- ProcedureParam , ReferentialAction , RenameTableNameKind , ReplicaIdentity , TagsColumnOption ,
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 , AlterTextSearch ,
69+ AlterTextSearchDictionaryOption , AlterTextSearchOperation , AlterType , AlterTypeAddValue ,
70+ AlterTypeAddValuePosition , AlterTypeOperation , AlterTypeRename , AlterTypeRenameValue ,
71+ ClusteredBy , ColumnDef , ColumnOption , ColumnOptionDef , ColumnOptions , ColumnPolicy ,
72+ ColumnPolicyProperty , ConstraintCharacteristics , CreateCollation , CreateCollationDefinition ,
73+ CreateConnector , CreateDomain , CreateExtension , CreateFunction , CreateIndex , CreateOperator ,
74+ CreateOperatorClass , CreateOperatorFamily , CreatePolicy , CreatePolicyCommand , CreatePolicyType ,
75+ CreateTable , CreateTextSearch , CreateTrigger , CreateView , Deduplicate , DeferrableInitial ,
76+ DistStyle , DropBehavior , DropExtension , DropFunction , DropOperator , DropOperatorClass ,
77+ DropOperatorFamily , DropOperatorSignature , DropPolicy , DropTrigger , ForValues ,
78+ FunctionReturnType , GeneratedAs , GeneratedExpressionMode , IdentityParameters ,
79+ IdentityProperty , IdentityPropertyFormatKind , IdentityPropertyKind , IdentityPropertyOrder ,
80+ IndexColumn , IndexOption , IndexType , KeyOrIndexDisplay , Msck , NullsDistinctOption ,
81+ OperatorArgTypes , OperatorClassItem , OperatorFamilyDropItem , OperatorFamilyItem ,
82+ OperatorOption , OperatorPurpose , Owner , Partition , PartitionBoundValue , ProcedureParam ,
83+ ReferentialAction , RenameTableNameKind , ReplicaIdentity , TagsColumnOption ,
8384 TextSearchObjectType , TriggerObjectKind , Truncate , UserDefinedTypeCompositeAttributeDef ,
8485 UserDefinedTypeInternalLength , UserDefinedTypeRangeOption , UserDefinedTypeRepresentation ,
8586 UserDefinedTypeSqlDefinitionOption , UserDefinedTypeStorage , ViewColumnDef ,
@@ -2451,6 +2452,8 @@ impl fmt::Display for ShowCreateObject {
24512452#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
24522453/// Objects that can be targeted by a `COMMENT` statement.
24532454pub enum CommentObject {
2455+ /// A collation.
2456+ Collation ,
24542457 /// A table column.
24552458 Column ,
24562459 /// A database.
@@ -2486,6 +2489,7 @@ pub enum CommentObject {
24862489impl fmt:: Display for CommentObject {
24872490 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
24882491 match self {
2492+ CommentObject :: Collation => f. write_str ( "COLLATION" ) ,
24892493 CommentObject :: Column => f. write_str ( "COLUMN" ) ,
24902494 CommentObject :: Database => f. write_str ( "DATABASE" ) ,
24912495 CommentObject :: Domain => f. write_str ( "DOMAIN" ) ,
@@ -3770,6 +3774,11 @@ pub enum Statement {
37703774 /// ```
37713775 AlterType ( AlterType ) ,
37723776 /// ```sql
3777+ /// ALTER COLLATION
3778+ /// ```
3779+ /// See [PostgreSQL](https://www.postgresql.org/docs/current/sql-altercollation.html)
3780+ AlterCollation ( AlterCollation ) ,
3781+ /// ```sql
37733782 /// ALTER OPERATOR
37743783 /// ```
37753784 /// See [PostgreSQL](https://www.postgresql.org/docs/current/sql-alteroperator.html)
@@ -3971,6 +3980,12 @@ pub enum Statement {
39713980 /// Note: this is a PostgreSQL-specific statement,
39723981 CreateExtension ( CreateExtension ) ,
39733982 /// ```sql
3983+ /// CREATE COLLATION
3984+ /// ```
3985+ /// Note: this is a PostgreSQL-specific statement.
3986+ /// <https://www.postgresql.org/docs/current/sql-createcollation.html>
3987+ CreateCollation ( CreateCollation ) ,
3988+ /// ```sql
39743989 /// DROP EXTENSION [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
39753990 /// ```
39763991 /// Note: this is a PostgreSQL-specific statement.
@@ -5441,6 +5456,7 @@ impl fmt::Display for Statement {
54415456 }
54425457 Statement :: CreateIndex ( create_index) => create_index. fmt ( f) ,
54435458 Statement :: CreateExtension ( create_extension) => write ! ( f, "{create_extension}" ) ,
5459+ Statement :: CreateCollation ( create_collation) => write ! ( f, "{create_collation}" ) ,
54445460 Statement :: DropExtension ( drop_extension) => write ! ( f, "{drop_extension}" ) ,
54455461 Statement :: DropOperator ( drop_operator) => write ! ( f, "{drop_operator}" ) ,
54465462 Statement :: DropOperatorFamily ( drop_operator_family) => {
@@ -5519,6 +5535,7 @@ impl fmt::Display for Statement {
55195535 Statement :: AlterType ( AlterType { name, operation } ) => {
55205536 write ! ( f, "ALTER TYPE {name} {operation}" )
55215537 }
5538+ Statement :: AlterCollation ( alter_collation) => write ! ( f, "{alter_collation}" ) ,
55225539 Statement :: AlterOperator ( alter_operator) => write ! ( f, "{alter_operator}" ) ,
55235540 Statement :: AlterOperatorFamily ( alter_operator_family) => {
55245541 write ! ( f, "{alter_operator_family}" )
@@ -8393,6 +8410,8 @@ impl fmt::Display for HavingBoundKind {
83938410#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
83948411/// Types of database objects referenced by DDL statements.
83958412pub enum ObjectType {
8413+ /// A collation.
8414+ Collation ,
83968415 /// A table.
83978416 Table ,
83988417 /// A view.
@@ -8422,6 +8441,7 @@ pub enum ObjectType {
84228441impl fmt:: Display for ObjectType {
84238442 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
84248443 f. write_str ( match self {
8444+ ObjectType :: Collation => "COLLATION" ,
84258445 ObjectType :: Table => "TABLE" ,
84268446 ObjectType :: View => "VIEW" ,
84278447 ObjectType :: MaterializedView => "MATERIALIZED VIEW" ,
@@ -12024,6 +12044,12 @@ impl From<CreateExtension> for Statement {
1202412044 }
1202512045}
1202612046
12047+ impl From < CreateCollation > for Statement {
12048+ fn from ( c : CreateCollation ) -> Self {
12049+ Self :: CreateCollation ( c)
12050+ }
12051+ }
12052+
1202712053impl From < DropExtension > for Statement {
1202812054 fn from ( de : DropExtension ) -> Self {
1202912055 Self :: DropExtension ( de)
@@ -12144,6 +12170,12 @@ impl From<AlterType> for Statement {
1214412170 }
1214512171}
1214612172
12173+ impl From < AlterCollation > for Statement {
12174+ fn from ( a : AlterCollation ) -> Self {
12175+ Self :: AlterCollation ( a)
12176+ }
12177+ }
12178+
1214712179impl From < AlterOperator > for Statement {
1214812180 fn from ( a : AlterOperator ) -> Self {
1214912181 Self :: AlterOperator ( a)
0 commit comments