Re: A small bug in gram.y - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: A small bug in gram.y
Date
Msg-id 4AF05EED.20206@enterprisedb.com
Whole thread Raw
In response to Re: A small bug in gram.y  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: A small bug in gram.y
List pgsql-hackers
Tom Lane wrote:
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
>> Heikki Linnakangas <heikki.linnakangas@enterprisedb.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


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: EOL for 7.4?
Next
From: Pavel Stehule
Date:
Subject: Re: EOL for 7.4?