Re: [SQL] WHERE parent IN (0,-1) - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] WHERE parent IN (0,-1)
Date
Msg-id 10969.933184043@sss.pgh.pa.us
Whole thread Raw
In response to Re: [SQL] WHERE parent IN (0,-1)  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-sql
>> It's a grammar problem.  in_expr_nodes and not_in_expr_nodes expect 
>> the elements of the IN-list to be AexprConst ... I wonder why not 
>> a_expr instead?  Might be a reduce conflict, but I bet we could at 
>> least use b_expr.  Thomas, any comments?

Indeed, there is no reduce conflict created by using a_expr, so I went
ahead and committed it.  Also tidied the list-generating code a bit.
Stuff like

select * from int4_tbl where f1 not in (0,123455+1);

seems to work fine now.

Drew, if you don't want to wait around for 6.6 to fix this, you
should be able to just change the occurrences of AexprConst to a_expr
in the productions for in_expr_nodes: and not_in_expr_nodes: in
src/backend/parser/gram.y.  I wouldn't advise trying to copy the current
gram.y into 6.5, since there are a bunch of other changes in it already...
        regards, tom lane


pgsql-sql by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [SQL] WHERE parent IN (0,-1)
Next
From: Matthew Hagerty
Date:
Subject: Join with blank records.