Re: POSIX RE starting with a (

Поиск
Список
Период
Сортировка
От Nick Barr
Тема Re: POSIX RE starting with a (
Дата
Msg-id 411A2D01.10909@chuckie.co.uk
обсуждение исходный текст
Ответ на POSIX RE starting with a (  (Nick Barr <nicky@chuckie.co.uk>)
Ответы Re: POSIX RE starting with a (  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-general
Nick Barr wrote:

> Hi,
>
> Just noticed something funny with the POSIX Regular expressions and
> wondered if it is a bug, or whether I am doing something wrong. I am
> using the POSIX RE in a function that is used in several places so would
> have to put some nasty if statement in there for this side case if there
> is not work around.
>
> ======================================================================
> intranet=# select track_id, track_name from ms_track where track_name
> like '(%';
>  track_id |           track_name
> ----------+---------------------------------
>      1294 | (I Can''t Get No) Satisfaction
>      1340 | (Hidden Track)
>      1503 | (Nice Dream)
>      1942 | (I) Get Lost
> (4 rows)
>
> intranet=# select track_name from ms_track where track_name ~ '^\(';
> ERROR:  invalid regular expression: parentheses () not balanced
> intranet=# select track_name from ms_track where track_name ~ '^(';
> ERROR:  invalid regular expression: parentheses () not balanced
> intranet=# select track_name from ms_track where track_name ~ '^\(';
> ERROR:  invalid regular expression: parentheses () not balanced
> ======================================================================
>
> Now I have tried a similar query using the PHP POSIX Regular Expressions
> and it accepts the sequence '^\(' and matches correctly. Is this a
> "feature" of PG that cannot be worked around easily?
>
> Any thoughts?
>
> Thanks
>
> Nick
>
> P.S. Thanks a lot guys for all the hard work on 8.0, looks good to me.
> Lots of really useful features, PITR, Win32, Nested transactions. Good
> work guys!

Sorry should of said I am running PG 7.4.3.


Nick


В списке pgsql-general по дате отправления:

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: the behaviour of timestamp on postgres.
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Resultset problem or BUG !