Nick Barr <nicky@chuckie.co.uk> writes:
> intranet=# select track_name from ms_track where track_name ~ '^\(';
> ERROR: invalid regular expression: parentheses () not balanced
You've forgotten that the string-literal parser will eat one level of
backslashing. You need
intranet=# select track_name from ms_track where track_name ~ '^\\(';
to get that backslash into the regex parser.
regards, tom lane