Complete PostgreSQL CREATE TYPE Support
#2094
Open
+787
−46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds full parsing for all PostgreSQL
CREATE TYPEstatement variants. Previously only composite and enum types were supported.What's New
Range Types - Parse range type definitions with 6 configuration options
Base Types - Parse low-level type definitions with 19 options (INPUT/OUTPUT functions, ALIGNMENT, STORAGE, etc.)
Simple Declarations - Parse type shells without representation
The AST extends
UserDefinedTypeRepresentationwith three new variants (Range,SqlDefinition,None) and adds five supporting enums (UserDefinedTypeRangeOption,UserDefinedTypeSqlDefinitionOption,Alignment,UserDefinedTypeStorage,UserDefinedTypeInternalLength) with comprehensive rustdoc. The parser refactorsparse_create_type()into modular functions (parse_create_type_composite(),parse_create_type_range(), and base type option parsers) that handle all PostgreSQL type configuration syntax. Tests provide comprehensive coverage with explicit AST verification for all variants and edge cases. Added 17 PostgreSQL-specific keywords, necessary to parse the keywords used in the type options (ALIGNMENT, CANONICAL, INTERNALLENGTH, PASSEDBYVALUE, RECEIVE, SEND, STORAGE, SUBTYPE, TYPMOD_IN, etc.).Closes issue #2092