X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 69DA8D1E5F9 for ; Tue, 4 May 2004 15:14:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 86173-06 for ; Tue, 4 May 2004 15:14:33 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id A9F5BD1F0D6 for ; Tue, 4 May 2004 15:14:31 -0300 (ADT) Received: (qmail 11775 invoked by uid 500); 4 May 2004 18:19:02 -0000 Date: Tue, 4 May 2004 13:19:02 -0500 From: Bruno Wolff III To: Bradley Kieser Cc: pgsql-admin@postgresql.org Subject: Re: Where to submit a bug report? Message-ID: <20040504181902.GA11727@wolff.to> Mail-Followup-To: Bradley Kieser , pgsql-admin@postgresql.org References: <4097E5E1.2040105@kieser.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4097E5E1.2040105@kieser.net> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/34 X-Sequence-Number: 13350 On Tue, May 04, 2004 at 18:50:09 +0000, Bradley Kieser wrote: > Hi All, > > Is this the correct place to submit a bug report or should I do it > somewhere else? Bugs go to pgsql-bugs, how I don't think this is really a bug, but a "feature". > > BUG DETAILS: > > PG version 7.4.2 > Platform: Linux > > BUG DESC: > > Using aliases in the "select" part of a select clause isn't strongly > checked against the alias definitions in the FROM part of the SQL. > Specifically, if the alias in the "select" clause matches another table > name (not in the FROM list), then the select is applied against that > other table whereas the correct action would be to chuck and error. > > EXAMPLE: > > One table: acct_dets > One view: acct_dets_view created as select * from acct_dets_table where XXXX > > Select acct_dets.aaa, acct_dets.bbb from acct_dets_view; > > The above select is accepted and processed when it SHOULD throw an error. Postgres has a feature where tables not listed in FROM clauses get silently included. There is something that turns this off, but I think it is only available in the development version. This feature is really only useful for delete where there isn't a syntax to specify addition tables and you need to use a subquery instead. A number of people didn't like the way it works now as that usually when you end up using this feature it is a mistake in the query rather than intentional use.