Re: [HACKERS] A small bug in gram.y

2009-11-04 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: ... But pointing to ESCAPE is just weird. I've changed these all to @2 (LIKE, ILIKE, SIMILAR TO). regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to

Re: [HACKERS] A small bug in gram.y

2009-11-03 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@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;

Re: [HACKERS] A small bug in gram.y

2009-11-03 Thread Kevin Grittner
Heikki Linnakangas heikki.linnakan...@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. -Kevin -- Sent via

Re: [HACKERS] A small bug in gram.y

2009-11-03 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: Heikki Linnakangas heikki.linnakan...@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

Re: [HACKERS] A small bug in gram.y

2009-11-03 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: Kevin Grittner kevin.gritt...@wicourts.gov writes: Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: LINE 1: SELECT 'aa' NOT SIMILAR TO 123; ^ LINE 1: SELECT 'aa' SIMILAR TO 123; ^ I

Re: [HACKERS] A small bug in gram.y

2009-11-03 Thread Heikki Linnakangas
Tom Lane wrote: Kevin Grittner kevin.gritt...@wicourts.gov writes: Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: LINE 1: SELECT 'aa' NOT SIMILAR TO 123; ^ LINE 1: SELECT 'aa' SIMILAR TO 123; ^ I think the former

Re: [HACKERS] A small bug in gram.y

2009-11-03 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@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

Re: [HACKERS] A small bug in gram.y

2009-11-03 Thread Heikki Linnakangas
Tom Lane wrote: Heikki Linnakangas heikki.linnakan...@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:

Re: [HACKERS] A small bug in gram.y

2009-11-03 Thread Tom Lane
Kevin Grittner kevin.gritt...@wicourts.gov writes: Tom Lane t...@sss.pgh.pa.us wrote: Uh, why? It looks like it's complaining about the constant 123, not about the operator. I wrote that before I saw your post, which left me ambivalent. My thinking was that it seems clearest to me when it

Re: [HACKERS] A small bug in gram.y

2009-11-03 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: ... But pointing to ESCAPE is just weird. Maybe. The implementation's-eye view of this is that the construct is data SIMILAR-operator (pattern ESCAPE-operator escape-char) but I agree that isn't the way a user will think

Re: [HACKERS] A small bug in gram.y

2009-11-03 Thread Kevin Grittner
Tom Lane t...@sss.pgh.pa.us wrote: select nosuchfunction(1,2,3,avalidfunction(4)); ^ select nosuchfunction(1,2,3,avalidfunction(4)); ^ Which of these is less likely to be misread about which function

Re: [HACKERS] A small bug in gram.y

2009-11-02 Thread Gokulakannan Somasundaram
Hmmm no-one else feels this as a bug The logic is that a function call is made for similar and the position where SIMILAR occurs is at the third position, but it has been coded that it is at fifth position. Thanks, Gokul. On Tue, Oct 27, 2009 at 6:51 AM, Gokulakannan Somasundaram

Re: [HACKERS] A small bug in gram.y

2009-11-02 Thread Heikki Linnakangas
Gokulakannan Somasundaram wrote: Hmmm no-one else feels this as a bug The logic is that a function call is made for similar and the position where SIMILAR occurs is at the third position, but it has been coded that it is at fifth position. The function call is constructed for the

[HACKERS] A small bug in gram.y

2009-10-26 Thread Gokulakannan Somasundaram
Hi, In the gram.y, under a_expr rule under the subrule a_expr NOT SIMILAR TO a_expr%prec SIMILAR the action is as follows { FuncCall *n = makeNode(FuncCall); n-funcname = SystemFuncName(similar_escape); n-args =