Skip site navigation (1) Skip section navigation (2)

Re: Bug Report

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Douglas M(dot) Westfall" <dougw(at)net(dot)kent(dot)edu>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug Report
Date: 2003-11-23 18:43:49
Message-ID: 28503.1069613029@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Douglas M. Westfall" <dougw(at)net(dot)kent(dot)edu> writes:
> 1) table contains a valid inet field
> 2) query works fine in pgsql 7.2 & 7.3
> 3) query no longer works in pgsql 7.4

> select * from <table> where <field> ilike '%<inetvalue>%' ;  
> ERROR:  Unable to identify an operator '~~*' for types 'inet' and '"unknown"'
>         You will have to retype this query using an explicit cast

This certainly did not work in 7.3 (in fact, you are quoting the 7.3
spelling of the error message).

There is not and never has been a LIKE operator for inet values; it's
only defined for textual data types.  The reason it "worked" in 7.2 was
that 7.2 would implicitly cast the inet value to text for you.  In 7.3
we changed a lot of casts to not be implicitly invocable, because of the
potential for unexpected behavior.  Personally I'd class this as an
example of exactly the kind of unexpected behavior we meant to
prevent...

Short anser: cast the field value to text.

			regards, tom lane

In response to

  • Bug Report at 2003-11-21 04:09:04 from Douglas M. Westfall

pgsql-bugs by date

Next:From: Klint GoreDate: 2003-11-24 06:35:49
Subject: variable not found in subplan target list?
Previous:From: Tom LaneDate: 2003-11-23 18:30:16
Subject: Re: IpcSemaphoreCreate: semget(...) failed: No space left on device

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group