Re: POSIX RE starting with a ( - Mailing list pgsql-general

From Tom Lane
Subject Re: POSIX RE starting with a (
Date
Msg-id 5470.1092236587@sss.pgh.pa.us
Whole thread Raw
In response to POSIX RE starting with a (  (Nick Barr <nicky@chuckie.co.uk>)
Responses Re: POSIX RE starting with a (
List pgsql-general
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

pgsql-general by date:

Previous
From: "Liam Lesboch"
Date:
Subject: Re: Replication options?
Next
From: Sebastian Böck
Date:
Subject: Re: the behaviour of timestamp on postgres.