Re: Bug Report

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
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 07:54:16
Message-ID: 20031122235221.H37295@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, 22 Nov 2003, Douglas M. Westfall wrote:

> Yes, I have searched the archives, and searches for 'inet' or 'ilike' or
> 'inet+ilike' and 'inet&ilike' return 0 results each.
>
> Have I missed something?

I believe your problem is that you were relying on a cast from inet to
text (on which ilike is defined) which isn't marked as implicit,
you'd probably want:
select * from <table> where CAST(<field> as text) ilike <pattern>;

> > Please enter a FULL description of your problem:
> > ------------------------------------------------
> > 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>%' ;
> >
> > fails with:
> > ERROR: Unable to identify an operator '~~*' for types 'inet' and
> > '"unknown"'
> > You will have to retype this query using an explicit cast
> >
> >
> > Please describe a way to repeat the problem. Please try to provide a
> > concise reproducible example, if at all possible:
> > ----------------------------------------------------------------------
> >
> > select * from ipaddrs2 where ip2_address ilike '%10.123.252.4%' order by
> > ip2_address asc;
> >
> > CASTing the operator provides no resolution, as it causes syntax errors,
> > ie:
> > select * from ipaddrs2 where ip2_address ilike '%10.123.252.4%'::inet
> > order by ip2_address asc;
> > returns:
> > ERROR: invalid INET value '%10.123.252.4%'
> > AND:
> > select * from ipaddrs2 where ip2_address ilike CAST('%10.123.252.4% as
> > inet) order by ip2_address asc;
> > returns:
> > ERROR: invalid INET value '%10.123.252.4%'

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2003-11-23 17:44:01 Re: inner query bug
Previous Message Douglas M. Westfall 2003-11-23 03:59:58 Re: Bug Report