Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 5C2371337BBB for ; Wed, 9 Feb 2011 10:44:38 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 49217-04 for ; Wed, 9 Feb 2011 14:44:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vw0-f46.google.com (mail-vw0-f46.google.com [209.85.212.46]) by mail.postgresql.org (Postfix) with ESMTP id BC1261337B82 for ; Wed, 9 Feb 2011 10:44:30 -0400 (AST) Received: by vws16 with SMTP id 16so133440vws.19 for ; Wed, 09 Feb 2011 06:44:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:reply-to:to:subject:date:user-agent :references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=xc+RvC5owhj8W0PebRe02VaNQ+8IHNWu8MTvL52uwGI=; b=PAnUe0brK61eeEVBz2aA9iP23/oD/ahcyhAeNwimG9Ufd43ukfacLmkxX0tVEwgrB8 KaN2m0IHuY0wkh2VvQXGLP8a1gwYprMc6c42ZYSJ+CKvhW5CACKURda3uBxeiOH/4+Hx DAoMkKym02bm+bTUVKjFTf0iZ+nxilZ7rhwT4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=VAHSddrs5dP9x6rMgxn14r8OdUF9jzamZ5qHfkJGQzRO5KJDsKxL9eptqbhroN0Jv9 eb0vj/TWA4djl6WOj7AOjfPp9AMPFr67an1h5p1FmJOTeJc3T8vaPjDtcTZyAgUKQapD LC34QKOE/2fcXFLHX9vRvKuEW8DwoLZ06BS30= Received: by 10.220.177.196 with SMTP id bj4mr5256172vcb.128.1297262670939; Wed, 09 Feb 2011 06:44:30 -0800 (PST) Received: from tucker.localnet (c-24-17-164-54.hsd1.wa.comcast.net [24.17.164.54]) by mx.google.com with ESMTPS id w26sm88915vcf.45.2011.02.09.06.44.29 (version=SSLv3 cipher=RC4-MD5); Wed, 09 Feb 2011 06:44:30 -0800 (PST) From: Adrian Klaver Reply-To: adrian.klaver@gmail.com To: pgsql-general@postgresql.org, kaloyan@digsys.bg Subject: Re: Possible Bug Date: Wed, 9 Feb 2011 06:44:25 -0800 User-Agent: KMail/1.13.5 (Linux/2.6.32-28-generic; KDE/4.4.5; i686; ; ) References: <4D5263AA.9050807@digsys.bg> In-Reply-To: <4D5263AA.9050807@digsys.bg> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1251" Content-Transfer-Encoding: 7bit Message-Id: <201102090644.26376.adrian.klaver@gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.589 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: X-Archive-Number: 201102/361 X-Sequence-Number: 172627 On Wednesday, February 09, 2011 1:51:38 am Kaloyan Iliev Iliev wrote: > Hi, > I think I found something strange in PostgreSQL behavior. Here is an > example: > > > testdb=# CREATE TABLE test1 (test2 text, test3 text); > CREATE TABLE > testdb=# SELECT A.name FROM test1 A; > name > ------ > (0 rows) > > testdb=# INSERT INTO test1 (test2,test3) VALUES ('1','2'); > INSERT 0 1 > testdb=# INSERT INTO test1 (test2,test3) VALUES ('3','4'); > INSERT 0 1 > testdb=# SELECT A.name FROM test1 A; > name > ------- > (1,2) > (3,4) > (2 rows) > > customer.20080408=# SELECT name FROM test1; > ERROR: column "name" does not exist > LINE 1: SELECT name FROM test1; > > > testdb=# SELECT version(); > > version > --------------------------------------------------------------------------- > ------------------------------- PostgreSQL 8.4.5 on > amd64-portbld-freebsd8.1, compiled by GCC cc (GCC) 4.2.1 20070719 > [FreeBSD], 64-bit > (1 row) > > Obviously there is no column with name "name", but the SELECT query > (ONLY WHEN I USE ALIASES) returns result for it. > And if I have a column with name "name_en" and by mistake write it > "name", instead of error I receive strange data (ARRAY from all > columns), that I don't expect. > > Could you tell me if this is a bug or some feature I haven't heard of. Depending on your point of view both. For a good explanation see: http://www.depesz.com/index.php/2010/11/08/waiting-for-9-1-removed-autocast- footgun/ As detailed above this feature will go away in 9.1. > > Best regards, > Kaloyan Iliev -- Adrian Klaver adrian.klaver@gmail.com