pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #12276: Using old name of a renamed or dropped column in a sub-query does not throw error
Date: Fri, 19 Dec 2014 09:09:35 -0700 (MST)
Message-ID: <1419005375461-5831501.post@n5.nabble.com> (raw)
In-Reply-To: <CAG_j9uxe-LZ+GBAHOk0fC7esnHpKSxPfut-9zkUYuThBs36Qqg@mail.gmail.com>
References: <20141218213959.1903.81488@wrigleys.postgresql.org>
	<20141218215458.GR1768@alvh.no-ip.org>
	<CAG_j9uxe-LZ+GBAHOk0fC7esnHpKSxPfut-9zkUYuThBs36Qqg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

collin.peters wrote
> Wow, an amazing 'feature' for sure. Is there any use case where it
> actually
> makes sense? I'm just wondering if this is a case where it is better to
> stray from the spec? Would almost prefer a 'NOTICE' if you use an
> unqualified column reference in a sub-query.

Correlated subqueries must be able to see values in the outer relation to
function.  Those are quite useful. Since not everything needs or wants to be
table qualified it becomes difficult to selectively enforce such a
requirement.

Two possible solutions...

1. All correlated subqueries need to have external-able columns explicitly
prefixed
2. All normal subquery columns with two possible name resolutions need to be
prefixed

The first option causes your post-rename to fail but the original query
works.
The second option causes the original query to fail but the post-rename one
works.

You can require both and both queries fail.

I'm not saying I support these...though the option would be nice to prevent
just this sort of thing.

David J.



--
View this message in context: http://postgresql.nabble.com/BUG-12276-Using-old-name-of-a-renamed-or-dropped-column-in-a-sub-query-...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


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



view thread (5+ messages)

Message-ID: <1419005375461-5831501.post@n5.nabble.com>
Permalink:  ../1419005375461-5831501.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1419005375461-5831501.post@n5.nabble.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: david.g.johnston@gmail.com
  Subject: Re: BUG #12276: Using old name of a renamed or dropped column in a sub-query does not throw error
  In-Reply-To: <1419005375461-5831501.post@n5.nabble.com>
  References: <20141218213959.1903.81488@wrigleys.postgresql.org> <20141218215458.GR1768@alvh.no-ip.org> <CAG_j9uxe-LZ+GBAHOk0fC7esnHpKSxPfut-9zkUYuThBs36Qqg@mail.gmail.com> <1419005375461-5831501.post@n5.nabble.com>

* 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