Skip to content

Accept schema-qualified operator names in CREATE / DROP OPERATOR - #999

Closed
zzoraemon043 wants to merge 1 commit into
sql-formatter-org:masterfrom
zzoraemon043:fix/postgres-schema-qualified-operator
Closed

zzoraemon043 wants to merge 1 commit into
sql-formatter-org:masterfrom
zzoraemon043:fix/postgres-schema-qualified-operator

Conversation

@zzoraemon043

Copy link
Copy Markdown

Fixes #997

CREATE OPERATOR pg_catalog.!! (...) failed with Unexpected OPERATOR token, because property_access only accepts an identifier after the dot. DROP OPERATOR pg_catalog.!! (...) failed the same way.

The tokenizer now turns an operator token into an identifier when it comes right after a property access operator and right before an opening paren. That covers the operator name in CREATE / ALTER / DROP OPERATOR, which is always followed by its argument list, while SELECT foo.+; still raises the parse error that the existing test expects.

Operators that the PostgreSQL tokenizer does not know as a single token, such as ===, are still split into separate tokens, so public.=== is not covered here.

@nene

nene commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

I'm adopting a new policy for this repository: no AI-generated contributions. I don't care how good they are.

This is to preserve my sanity.

@nene nene closed this Oct 29, 2026
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.

[FORMATTING] Postgres Create Operator Error When Qualified

2 participants