First, thank you for maintaining sqlglot. It has been very useful for my personal project.
Problem
sqlglot fails to parse valid PostgreSQL COMMENT ON statements when the target is schema-qualified for some object kinds, notably TYPE and VIEW.
Reproduction
from sqlglot import Dialects, parse
cases = [
"COMMENT ON TYPE mood IS 'x';",
"COMMENT ON TYPE foo.mood IS 'x';",
"COMMENT ON VIEW foo.bat IS 'x';",
"COMMENT ON TABLE foo.bar IS 'x';",
"COMMENT ON COLUMN foo.bar.baz IS 'x';",
]
for sql in cases:
print(sql)
print(parse(sql, dialect=Dialects.POSTGRES))
ParseError: Required keyword: 'expression' missing for <class 'sqlglot.expressions.ddl.Comment'>.
First, thank you for maintaining sqlglot. It has been very useful for my personal project.
Problem
sqlglotfails to parse valid PostgreSQLCOMMENT ONstatements when the target is schema-qualified for some object kinds, notablyTYPEandVIEW.Reproduction