@@ -60,18 +60,19 @@ pub use self::dcl::{
6060 SetConfigValue , Use ,
6161} ;
6262pub use self :: ddl:: {
63- Alignment , AlterColumnOperation , AlterConnectorOwner , AlterIndexOperation , AlterOperator ,
64- AlterOperatorClass , AlterOperatorClassOperation , AlterOperatorFamily ,
65- AlterOperatorFamilyOperation , AlterOperatorOperation , AlterPolicy , AlterPolicyOperation ,
66- AlterSchema , AlterSchemaOperation , AlterTable , AlterTableAlgorithm , AlterTableLock ,
67- AlterTableOperation , AlterTableType , AlterType , AlterTypeAddValue , AlterTypeAddValuePosition ,
68- AlterTypeOperation , AlterTypeRename , AlterTypeRenameValue , ClusteredBy , ColumnDef ,
69- ColumnOption , ColumnOptionDef , ColumnOptions , ColumnPolicy , ColumnPolicyProperty ,
70- ConstraintCharacteristics , CreateConnector , CreateDomain , CreateExtension , CreateFunction ,
71- CreateIndex , CreateOperator , CreateOperatorClass , CreateOperatorFamily , CreatePolicy ,
72- CreatePolicyCommand , CreatePolicyType , CreateTable , CreateTrigger , CreateView , Deduplicate ,
73- DeferrableInitial , DropBehavior , DropExtension , DropFunction , DropOperator , DropOperatorClass ,
74- DropOperatorFamily , DropOperatorSignature , DropPolicy , DropTrigger , ForValues , GeneratedAs ,
63+ Alignment , AlterCollation , AlterCollationOperation , AlterColumnOperation , AlterConnectorOwner ,
64+ AlterIndexOperation , AlterOperator , AlterOperatorClass , AlterOperatorClassOperation ,
65+ AlterOperatorFamily , AlterOperatorFamilyOperation , AlterOperatorOperation , AlterPolicy ,
66+ AlterPolicyOperation , AlterSchema , AlterSchemaOperation , AlterTable , AlterTableAlgorithm ,
67+ AlterTableLock , AlterTableOperation , AlterTableType , AlterType , AlterTypeAddValue ,
68+ AlterTypeAddValuePosition , AlterTypeOperation , AlterTypeRename , AlterTypeRenameValue ,
69+ ClusteredBy , ColumnDef , ColumnOption , ColumnOptionDef , ColumnOptions , ColumnPolicy ,
70+ ColumnPolicyProperty , ConstraintCharacteristics , CreateCollation , CreateCollationDefinition ,
71+ CreateConnector , CreateDomain , CreateExtension , CreateFunction , CreateIndex , CreateOperator ,
72+ CreateOperatorClass , CreateOperatorFamily , CreatePolicy , CreatePolicyCommand , CreatePolicyType ,
73+ CreateTable , CreateTrigger , CreateView , Deduplicate , DeferrableInitial , DropBehavior ,
74+ DropExtension , DropFunction , DropOperator , DropOperatorClass , DropOperatorFamily ,
75+ DropOperatorSignature , DropPolicy , DropTrigger , ForValues , GeneratedAs ,
7576 GeneratedExpressionMode , IdentityParameters , IdentityProperty , IdentityPropertyFormatKind ,
7677 IdentityPropertyKind , IdentityPropertyOrder , IndexColumn , IndexOption , IndexType ,
7778 KeyOrIndexDisplay , Msck , NullsDistinctOption , OperatorArgTypes , OperatorClassItem ,
@@ -2437,6 +2438,8 @@ impl fmt::Display for ShowCreateObject {
24372438#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
24382439/// Objects that can be targeted by a `COMMENT` statement.
24392440pub enum CommentObject {
2441+ /// A collation.
2442+ Collation ,
24402443 /// A table column.
24412444 Column ,
24422445 /// A database.
@@ -2472,6 +2475,7 @@ pub enum CommentObject {
24722475impl fmt:: Display for CommentObject {
24732476 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
24742477 match self {
2478+ CommentObject :: Collation => f. write_str ( "COLLATION" ) ,
24752479 CommentObject :: Column => f. write_str ( "COLUMN" ) ,
24762480 CommentObject :: Database => f. write_str ( "DATABASE" ) ,
24772481 CommentObject :: Domain => f. write_str ( "DOMAIN" ) ,
@@ -3744,6 +3748,11 @@ pub enum Statement {
37443748 /// ```
37453749 AlterType ( AlterType ) ,
37463750 /// ```sql
3751+ /// ALTER COLLATION
3752+ /// ```
3753+ /// See [PostgreSQL](https://www.postgresql.org/docs/current/sql-altercollation.html)
3754+ AlterCollation ( AlterCollation ) ,
3755+ /// ```sql
37473756 /// ALTER OPERATOR
37483757 /// ```
37493758 /// See [PostgreSQL](https://www.postgresql.org/docs/current/sql-alteroperator.html)
@@ -3940,6 +3949,12 @@ pub enum Statement {
39403949 /// Note: this is a PostgreSQL-specific statement,
39413950 CreateExtension ( CreateExtension ) ,
39423951 /// ```sql
3952+ /// CREATE COLLATION
3953+ /// ```
3954+ /// Note: this is a PostgreSQL-specific statement.
3955+ /// <https://www.postgresql.org/docs/current/sql-createcollation.html>
3956+ CreateCollation ( CreateCollation ) ,
3957+ /// ```sql
39433958 /// DROP EXTENSION [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
39443959 /// ```
39453960 /// Note: this is a PostgreSQL-specific statement.
@@ -5389,6 +5404,7 @@ impl fmt::Display for Statement {
53895404 }
53905405 Statement :: CreateIndex ( create_index) => create_index. fmt ( f) ,
53915406 Statement :: CreateExtension ( create_extension) => write ! ( f, "{create_extension}" ) ,
5407+ Statement :: CreateCollation ( create_collation) => write ! ( f, "{create_collation}" ) ,
53925408 Statement :: DropExtension ( drop_extension) => write ! ( f, "{drop_extension}" ) ,
53935409 Statement :: DropOperator ( drop_operator) => write ! ( f, "{drop_operator}" ) ,
53945410 Statement :: DropOperatorFamily ( drop_operator_family) => {
@@ -5465,6 +5481,7 @@ impl fmt::Display for Statement {
54655481 Statement :: AlterType ( AlterType { name, operation } ) => {
54665482 write ! ( f, "ALTER TYPE {name} {operation}" )
54675483 }
5484+ Statement :: AlterCollation ( alter_collation) => write ! ( f, "{alter_collation}" ) ,
54685485 Statement :: AlterOperator ( alter_operator) => write ! ( f, "{alter_operator}" ) ,
54695486 Statement :: AlterOperatorFamily ( alter_operator_family) => {
54705487 write ! ( f, "{alter_operator_family}" )
@@ -8230,6 +8247,8 @@ impl fmt::Display for HavingBoundKind {
82308247#[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
82318248/// Types of database objects referenced by DDL statements.
82328249pub enum ObjectType {
8250+ /// A collation.
8251+ Collation ,
82338252 /// A table.
82348253 Table ,
82358254 /// A view.
@@ -8259,6 +8278,7 @@ pub enum ObjectType {
82598278impl fmt:: Display for ObjectType {
82608279 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
82618280 f. write_str ( match self {
8281+ ObjectType :: Collation => "COLLATION" ,
82628282 ObjectType :: Table => "TABLE" ,
82638283 ObjectType :: View => "VIEW" ,
82648284 ObjectType :: MaterializedView => "MATERIALIZED VIEW" ,
@@ -11816,6 +11836,12 @@ impl From<CreateExtension> for Statement {
1181611836 }
1181711837}
1181811838
11839+ impl From < CreateCollation > for Statement {
11840+ fn from ( c : CreateCollation ) -> Self {
11841+ Self :: CreateCollation ( c)
11842+ }
11843+ }
11844+
1181911845impl From < DropExtension > for Statement {
1182011846 fn from ( de : DropExtension ) -> Self {
1182111847 Self :: DropExtension ( de)
@@ -11924,6 +11950,12 @@ impl From<AlterType> for Statement {
1192411950 }
1192511951}
1192611952
11953+ impl From < AlterCollation > for Statement {
11954+ fn from ( a : AlterCollation ) -> Self {
11955+ Self :: AlterCollation ( a)
11956+ }
11957+ }
11958+
1192711959impl From < AlterOperator > for Statement {
1192811960 fn from ( a : AlterOperator ) -> Self {
1192911961 Self :: AlterOperator ( a)
0 commit comments