Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Bugs > BUG #4275: Mult...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 3889 of 3967
Post > Topic >>

BUG #4275: Multicolumn subquery expression not allowed on both sides of IS DISTINCT FROM

by c-d.hailfinger.devel.2006@[EMAIL PROTECTED] ("Carl-Daniel Hailfinger") Jul 1, 2008 at 02:47 AM

The following bug has been logged online:

Bug reference:      4275
Logged by:          Carl-Daniel Hailfinger
Email address:      c-d.hailfinger.devel.2006@[EMAIL PROTECTED]
 version: 8.2.9
Operating system:   openSUSE Linux 10.3, x86
Description:        Multicolumn subquery expression not allowed on both
sides of IS DISTINCT FROM
Details: 

The PostgreSQL docs say a multicolumn subquery expression is not allowed
on
both sides of IS DISTINCT FROM. The implementation conforms to the docs,
but
AFAICS the SQL:2003 standard allows multicolumn subquery expressions on
both
sides of the operator.

This works:
# SELECT ROW(true,true)=(SELECT true,true);

This doesn't:
# SELECT (SELECT true,true)=(SELECT true,true);
Error:  42601: subquery must return only one column
Location:  transformSubLink, parse_expr.c:1139

Expected result:
The second query has the same result as the first query (true).


Please allow me to explain why I think the standard allows multicolumn
subqueries on both sides of IS DISTINCT FROM:

  <distinct predicate>    ::=   <row value predicand 3> <distinct
predicate
part 2>

  <distinct predicate part 2>    ::=   IS DISTINCT FROM <row value
predicand
4>

  <row value predicand 3>    ::=   <row value predicand>

  <row value predicand 4>    ::=   <row value predicand> 

    <row value predicand>    ::=
         <row value special case>
     |     <row value constructor predicand> 

    <row value constructor predicand>    ::=
         <common value expression>
     |     <boolean predicand>
     |     <explicit row value constructor> 

    <explicit row value constructor>    ::=
         <left paren> <row value constructor element> <comma> <row value
constructor element list> <right paren>
     |     ROW <left paren> <row value constructor element list> <right
paren>
     |     <row subquery> 


So the following should be valid:
  <distinct predicate>    ::=  <row subquery> IS DISTINCT FROM <row
subquery>

Somebody in the #postgresql irc channel was so kind to test this on 8.3.3
with the same results.

Regards,
Carl-Daniel

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
 




 4 Posts in Topic:
BUG #4275: Multicolumn subquery expression not allowed on both s
c-d.hailfinger.devel.2006  2008-07-01 02:47:45 
Re: BUG #4275: Multicolumn subquery expression not allowed on bo
tgl@[EMAIL PROTECTED] (T  2008-07-01 10:32:36 
Re: BUG #4275: Multicolumn subquery expression not allowed
c-d.hailfinger.devel.2006  2008-07-02 19:51:19 
Re: BUG #4275: Multicolumn subquery expression not allowed on bo
tgl@[EMAIL PROTECTED] (T  2008-07-02 20:28:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Aug 21 22:30:25 CDT 2008.