pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: otter117@yahoo.de
To: pgsql-docs@postgresql.org
Subject: undocumented feature or bug in subquery : psql (PostgreSQL) 9.4.6 on SLES12 SP1
Date: Thu, 25 Aug 2016 16:29:00 +0000
Message-ID: <20160825162900.15675.78433@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.4/static/functions-subquery.html
Description:

psql (PostgreSQL) 9.4.6 on SLES12 SP1
2 tables a and b
               Table &quot;public.a&quot;
     Column      |           Type           |   Modifiers
-----------------+--------------------------+---------------
 foo             | integer                  | not null
 bar             | integer                  | not null

               Table &quot;public.b&quot;
     Column      |           Type           |   Modifiers
-----------------+--------------------------+---------------
 bar             | integer                  | not null

No error when executing this statement even though table b does not contain
column foo
SELECT foo,bar FROM a WHERE foo=1 AND bar NOT IN (SELECT bar FROM b WHERE
bar &gt; 2 AND foo=2)

Get an error on this one ERROR:  column b.foo does not exist
SELECT foo,bar FROM a WHERE foo=1 AND bar NOT IN (SELECT bar FROM b WHERE
b.bar &gt; 2 AND b.foo=2)

It works if I remove foo from the subquery.
SELECT foo,bar FROM a WHERE foo=1 AND bar NOT IN (SELECT bar FROM b WHERE
b.bar &gt; 2)

Do I need to qualify all columns in the subquery or is this a bug is psql
9.4.6?


-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


view thread (2+ messages)  latest in thread

Message-ID: <20160825162900.15675.78433@wrigleys.postgresql.org>
Permalink:  ../20160825162900.15675.78433@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20160825162900.15675.78433@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: otter117@yahoo.de
  Subject: Re: undocumented feature or bug in subquery : psql (PostgreSQL) 9.4.6 on SLES12 SP1
  In-Reply-To: <20160825162900.15675.78433@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox