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

From Tom Lane
Subject Re: A small bug in gram.y
Date
Msg-id 3251.1257259091@sss.pgh.pa.us
Whole thread Raw
In response to Re: A small bug in gram.y  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Here's an example that exercises those paths:

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

> I think the former error location is better.

FWIW, I like the second one better, and if you check around you'll find
that it matches most other similar stuff, eg

regression=# select 12 like 34;
ERROR:  operator does not exist: integer ~~ integer
LINE 1: select 12 like 34;                 ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

I think the current coding probably is just a typo, but hadn't gotten
around to doing anything about it.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: new version of PQconnectdb was:(Re: [HACKERS] Determining client_encoding from client locale)
Next
From: Peter Eisentraut
Date:
Subject: Re: new version of PQconnectdb was:(Re: [HACKERS] Determining client_encoding from client locale)