Re: RE in where

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Patrick Nelson <pnelson(at)neatech(dot)com>
Cc: "PostgreSQL List (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: RE in where
Date: 2003-02-17 22:27:47
Message-ID: 15829.1045520867@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Patrick Nelson <pnelson(at)neatech(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-02-17 22:49:54 Re: TIMESTAMP WITH( OUT)? TIME ZONE indexing/type choice...
Previous Message Tom Lane 2003-02-17 22:23:32 Re: Compatible UNION query for postgresql and MS SQL Server