Subject: | Pg parser's parsing of CHECK breaks on close paren |
The Pg parser expects a CHECK will break if anything in the check
contains a close paren, like this:
CHECK ( VALUE ~ E'(.+)' )
The parser stops at the first close paren, which is obviously wrong. I
tried fixing this but got a bit stuck. At first I thought I want to
match balanced parens, but that's not right since, you can have a valid
CHECK with unbalanced parens:
CHECK ( VALUES =~ E'^[^)]$' )
I couldn't think of any good solution that didn't involve really parsing
what's inside the parens which bound the CHECK rule, and I wasn't even
sure how best to do that.