Skip to content

sqlparser-cs cannot parse PostgreSQL alias with column and datatype syntax #77

@trannamtrung1st

Description

@trannamtrung1st

Description

The sqlparser-cs library fails to parse PostgreSQL's table alias syntax that includes column definitions with data types.

Expected Behavior

The parser should successfully parse PostgreSQL table aliases with column and datatype specifications like:

SELECT * FROM some_table AS alias(col1 text, col2 int)

Actual Behavior

The parser throws a parsing error when encountering this syntax.

Environment

  • Library: sqlparser-cs
  • Database: PostgreSQL

Additional Context

This syntax is valid PostgreSQL and is commonly used when:

  • Creating table aliases with specific column types
  • Working with derived tables that need explicit column typing
  • Ensuring type safety in complex queries

The syntax follows the pattern: table_name AS alias_name(column_name data_type, ...)

Related Documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions