Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 31B3379786B for ; Wed, 17 Mar 2010 11:48:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 27953-03 for ; Wed, 17 Mar 2010 14:48:09 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pz0-f201.google.com (mail-pz0-f201.google.com [209.85.222.201]) by mail.postgresql.org (Postfix) with ESMTP id 70C85797D77 for ; Wed, 17 Mar 2010 11:48:09 -0300 (ADT) Received: by pzk39 with SMTP id 39so730857pzk.15 for ; Wed, 17 Mar 2010 07:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HtERq8XVBe0R+0+a+2CbezSbhlnsgnJofY4o4RNwiGw=; b=xJi0f0S822MF5H/O+ix3uV3mhBSGD8SHfg03rRwpymxbmJo4zVX+r/dANflDfoN9TI Sr8nuFQcEGanVDrbmpq0Jqmh/4aWyd2JC3r0zp2n1JoSGlShJxLL5s0ivVhKqQs5Zkel fmknfofHL9tpARNGd+iO6N5TGSYMphgxudUz8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=N+6mrVtbpswouUhDpHG33M2KiC+nsgsyiRdcnX4j1VWvjWcrMLDSCkv+T3yfusiqyX jQPckMZCa25CKdLKoO085INAj/xz1sODIbeISX2yB3gLEPF6UNgArkebdg3eA8m0TXDR uT/aA7PWtNRuL9nJRUwosoPV+sFAdRBdMgZKc= MIME-Version: 1.0 Received: by 10.114.28.5 with SMTP id b5mr819420wab.7.1268837286944; Wed, 17 Mar 2010 07:48:06 -0700 (PDT) In-Reply-To: <8AB806D0-91F7-4D31-BB6E-690E4419C770@socialserve.com> References: <8AB806D0-91F7-4D31-BB6E-690E4419C770@socialserve.com> Date: Wed, 17 Mar 2010 11:48:06 -0300 Message-ID: <690707f61003170748q3e5a38cfvee438e6efd871726@mail.gmail.com> Subject: Re: 8.4 versus 8.2 against nonexistent column "name" ... From: Osvaldo Kussama To: James Robinson Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201003/137 X-Sequence-Number: 33844 2010/3/17 James Robinson : > Can anyone shine a light on why 8.4 behaves surprisingly when being queri= ed > for a bogus column "name", but only using qualified table/column referenc= es. > > Here's a sample script: > > ----- > create table foo > ( > =A0 =A0 =A0 =A0id int, > =A0 =A0 =A0 =A0x int > ); > > insert into foo(id, x) > values > =A0 =A0 =A0 =A0(1, 23), > =A0 =A0 =A0 =A0(2, 43), > =A0 =A0 =A0 =A0(4, 45); > > -- Fails on both -- no column named 'name' > select name from foo; > > -- Fails on 8.2, still no 'name' column, but 8.4 succeeds returning whole > rows. > select f.name from foo f; > ---- > > On 8.2.11, both selects fail: > > CREATE TABLE > INSERT 0 3 > ERROR: =A0column "name" does not exist > LINE 1: select name from foo; > =A0 =A0 =A0 =A0 =A0 =A0 =A0^ > ERROR: =A0column f.name does not exist > LINE 1: select f.name from foo f; > =A0 =A0 =A0 =A0 =A0 =A0 =A0^ > > > On 8.4.2, the first select fails, but the second succeeds, returning whol= e > rows wrapped up like tuples: > > CREATE TABLE > INSERT 0 3 > ERROR: =A0column "name" does not exist > LINE 1: select name from foo; > =A0 =A0 =A0 =A0 =A0 =A0 =A0^ > =A0name > -------- > (1,23) > (2,43) > (4,45) > (3 rows) > > A quick skim through the 8.3. and 8.4. release notes found nothing > interesting related to 'name'. > See this thread: http://archives.postgresql.org/pgsql-general/2010-02/msg01035.php Osvaldo