Re: RE in where

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: RE in where
Дата
Msg-id 15829.1045520867@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: RE in where  (Patrick Nelson <pnelson@neatech.com>)
Список pgsql-general
Patrick Nelson <pnelson@neatech.com> writes:
> Ran a query that I run periodically and it no longer works.  It looks like:
>   SELECT * FROM hosts WHERE host ~ '^61.216.';
> However, now I get an error:
>   ERROR: Unable to identify an operator '~' for types 'inet' and '"unknown"'
>          You will have to retype this query using an explicit cast

The inet-to-text cast isn't implicit anymore.  You need an explicit
cast:
  SELECT * FROM hosts WHERE host::text ~ '^61.216.';

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Compatible UNION query for postgresql and MS SQL Server
Следующее
От: Tom Lane
Дата:
Сообщение: Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...