pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Douglas M. Westfall <dougw@net.kent.edu>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Bug Report
Date: Sun, 23 Nov 2003 13:43:49 -0500
Message-ID: <28503.1069613029@sss.pgh.pa.us> (raw)
In-Reply-To: <1069387744.2491.1.camel@dw2>
References: <1069387744.2491.1.camel@dw2>

"Douglas M. Westfall" <dougw@net.kent.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



view thread (28+ messages)  latest in thread

Message-ID: <28503.1069613029@sss.pgh.pa.us>
Permalink:  ../28503.1069613029@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/28503.1069613029@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dougw@net.kent.edu
  Subject: Re: Bug Report
  In-Reply-To: <28503.1069613029@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox