Closed evanj closed 1 year ago
As far as I know so far: this $
token is always a parse error. According to my reading of the documentation, Postgres does not permit $ as an operator, but it does permit it:
SELECT $5
;CREATE TABLE valid$identifier ();
SELECT $$string with $ lots of stuff$$;
SELECT $name$my string$name$;
I found this because I wrote a fuzz test for a tool that is rewriting Postgres queries using https://github.com/pganalyze/pg_query_go , and it happened to generate this. The "unsupported" token caused my fuzz test to be unhappy.
So: This isn't "needed", except for completeness for supporting any Postgres tool.
Postgres's scanner will scan $ into a single token. For example:
The parser will later reject this. However, since the scanner returns this value, we should define a Token for it in the protobuf.
test/scan.c: