How to parse POSITION(A IN B) #430
-
This is for PostgreSQL. I can specify:
But even without this, the parser is fine with POSITION. The problem is the IN token. Because there are no parentheses around 'B', it doesn't work. I am not sure how to modify parse_in() in parser.py to account for this. |
Beta Was this translation helpful? Give feedback.
Answered by
georgesittas
Sep 15, 2022
Replies: 1 comment
-
I think that there are two options here. You can:
There are some examples you can follow if you want to do the first one (see latest commits related to trim, substring). |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
tobymao
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think that there are two options here. You can:
parse_in
as is and create a custom function parser forPOSITION
, then add it toFUNCTION_PARSERS
.parse_in
by adding another case to check if '(' can be matched. If it can't, just parse a single expression.There are some examples you can follow if you want to do the first one (see latest commits related to trim, substring).