Re: A small bug in gram.y

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Gokulakannan Somasundaram <gokul007(at)gmail(dot)com>, pgsql-hackers list <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A small bug in gram.y
Date: 2009-11-03 16:48:45
Message-ID: 4AF05EED.20206@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
>> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>>> LINE 1: SELECT 'aa' NOT SIMILAR TO 123;
>>> ^
>
>>> LINE 1: SELECT 'aa' SIMILAR TO 123;
>>> ^
>
>>> I think the former error location is better.
>
>> So do I.
>
> Uh, why? It looks like it's complaining about the constant 123,
> not about the operator.

The problem *is* in the constant 123. It's of wrong type for SIMILAR TO
operator. I guess your viewpoint is that the operator isn't correct for
the operands. Fair enough.

BTW, the corresponding error in the "SIMILAR TO ... ESCAPE ..." syntax is:

postgres=# SELECT 'aa' SIMILAR TO 123 ESCAPE 'f';
ERROR: function pg_catalog.similar_escape(integer, unknown) does not exist
LINE 1: SELECT 'aa' SIMILAR TO 123 ESCAPE 'f';
^
HINT: No function matches the given name and argument types. You might
need to add explicit type casts.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2009-11-03 16:51:03 Re: operator exclusion constraints
Previous Message Kevin Grittner 2009-11-03 16:39:10 Re: A small bug in gram.y