Re: how to test string against regular expression contained in postgresql database field?

Поиск
Список
Период
Сортировка
От joe@tsolucio.com (Joe Bordes)
Тема Re: how to test string against regular expression contained in postgresql database field?
Дата
Msg-id 9a0f19e3.0403251048.3b7bdbde@posting.google.com
обсуждение исходный текст
Ответ на how to test string against regular expression contained in postgresql database field?  (joe@tsolucio.com (Joe Bordes))
Ответы Re: how to test string against regular expression contained  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-novice
CoL <col@mportal.hu> wrote in message news:<c3s060$1k0m$1@news.hub.org>...
>
> create a function for that.
>
> create or replace function osregexp(varchar,varchar) returns boolean as
> ' select $1 ~ $2; 'language sql immutable;
>
> SELECT osregexp('windows9x','win.*9x');
>   osregexp
> ----------
>   t
>
> C.

Hi,

First thanks for answering.

This gives me the same error. I have created the function as you say
and it works when called directly with strings (as above) but not when
called with a table field.

select os_name from table where osregexp('windows9x',os_regexp);
ERROR: invalid regular expression: empty expression or subexpression

I even tried createing the function with STABLE and VOLATILE but I get
the same error

Joe.

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

Предыдущее
От: "Okeh, Sam"
Дата:
Сообщение:
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Extract Function