Re: Regular Expression Data Type

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Regular Expression Data Type
Дата
Msg-id 24675.1177172997@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Regular Expression Data Type  (Richard Doust <rdoust@mac.com>)
Список pgsql-general
Richard Doust <rdoust@mac.com> writes:
> What I'd like to be able to do is to define a field in the database
> as a regular expression so that when I select, i.e.,

> select price from shipping_prices where shipFromZip = '23773' and
> shipToZip ~ '87927'

> because shipToZip is defined as a regular expression, I'd match a row
> where shipToZip held the value '879[0-9]{2,2}' or '87[0-9]*'.

I don't see the problem ... you just write a variable instead of a
constant on the right-hand side of ~, no?

How efficient this might be is another question, but it works.

            regards, tom lane

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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Regular Expression Data Type
Следующее
От: "Leticia"
Дата:
Сообщение: PostgreSQL configuration