Postgres dialect: parse error for "on delete" in column constraint #1554
Labels
bug
Something isn't working
good first issue
Good for newcomers
postgres
Issues relating to the Postgres dialect
Expected Behaviour
Sqlfluff parses column constraints containing "on delete" clause.
To see Postgres's column_constraint structure, search for "on delete" on this page: https://www.postgresql.org/docs/current/sql-createtable.html
Observed Behaviour
Sqlfluff throws parse error if "on delete" clause of a column constraint exists.
Looks like
match / on delete / on update
clauses are recognized in a table constraint:sqlfluff/src/sqlfluff/dialects/dialect_postgres.py
Line 1136 in 304a197
But not in a column constraint:
sqlfluff/src/sqlfluff/dialects/dialect_postgres.py
Line 1028 in 304a197
Steps to Reproduce
Test sql file follows:
Try to parse that file:
Dialect
Postgres
Version
Configuration
Thanks for making an SQL linter! Happy to see tools improving in this area. 😀
The text was updated successfully, but these errors were encountered: