Skip to content

PostgreSQL: Support SQL standard ARRAY keyword in type declarations#2356

Open
LucaCappelletti94 wants to merge 1 commit into
apache:mainfrom
LucaCappelletti94:array
Open

PostgreSQL: Support SQL standard ARRAY keyword in type declarations#2356
LucaCappelletti94 wants to merge 1 commit into
apache:mainfrom
LucaCappelletti94:array

Conversation

@LucaCappelletti94
Copy link
Copy Markdown
Contributor

Adds support for the SQL standard ARRAY keyword in array type declarations, such as INTEGER ARRAY and INTEGER ARRAY[4], which PostgreSQL accepts anywhere a type is expected (column definitions, casts, and the :: operator). It is gated behind a new Dialect::supports_array_typedef_with_keyword method, enabled for PostgreSQL, and the keyword form with its optional cardinality is represented by a new ArrayElemTypeDef::Keyword variant.

This also unifies the existing MySQL multi-valued index syntax CAST(... AS UNSIGNED ARRAY). The array: bool field on Expr::Cast is removed and the trailing ARRAY keyword is now captured through ArrayElemTypeDef::Keyword for every dialect, so this is a breaking change to the AST. Parser behavior is unchanged for all dialects, only the representation is unified, and round-trip serialization is preserved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant