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 4AF06353.1030801@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
Re: A small bug in gram.y
List pgsql-hackers
Tom Lane wrote:
> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
>> 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';
>>                                    ^
> 
> Well, that's complaining specifically about the ESCAPE part of it.
> This does expose the implementation detail that we try to build the
> similar_escape() call before the overall similar() function call.

Yeah. The "ESCAPE 'f'" part is OK. It's still the 123 that's of the
wrong type. I'd say that message should point to 123 as well. Or to
SIMILAR, if we take your stance that the error is with the SIMILAR TO
operator in general. But pointing to ESCAPE is just weird.

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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: EOL for 7.4?
Next
From: Tom Lane
Date:
Subject: Re: A small bug in gram.y