From: Kaloyan Iliev Iliev <kaloyan@digsys.bg>
To: pgsql-general@postgresql.org
Subject: Possible Bug
Date: Wed, 09 Feb 2011 11:51:38 +0200
Message-ID: <4D5263AA.9050807@digsys.bg> (raw)
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
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-general@postgresql.org
Cc: kaloyan@digsys.bg
Subject: Re: Possible Bug
In-Reply-To: <4D5263AA.9050807@digsys.bg>
References: <4D5263AA.9050807@digsys.bg>
* 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