Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 39CBB1337B83 for ; Wed, 9 Feb 2011 06:15:59 -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 58198-02 for ; Wed, 9 Feb 2011 10:15:53 +0000 (UTC) X-Greylist: delayed 00:24:13.743857 by SQLgrey-1.7.6 Received: from relay2.digsys.bg (varna.digsys.bg [192.92.129.9]) by mail.postgresql.org (Postfix) with ESMTP id B72D91337B69 for ; Wed, 9 Feb 2011 06:15:51 -0400 (AST) Received: from luke.digsys.bg (kaloyan@luke.digsys.bg [193.68.6.22]) by relay2.digsys.bg (8.14.4/8.14.4) with ESMTP id p199pajT083481 for ; Wed, 9 Feb 2011 11:51:36 +0200 (EET) (envelope-from kaloyan@digsys.bg) Message-ID: <4D5263AA.9050807@digsys.bg> Date: Wed, 09 Feb 2011 11:51:38 +0200 From: Kaloyan Iliev Iliev Reply-To: kaloyan@digsys.bg Organization: Register.BG Ltd. User-Agent: Thunderbird 2.0.0.24 (X11/20100614) MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Possible Bug Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201102/353 X-Sequence-Number: 172619 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. Best regards, Kaloyan Iliev