Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 4EBDB2EBA74 for ; Thu, 24 Nov 2011 05:45:02 -0400 (AST) Received: from wwwmaster.postgresql.org ([217.196.146.204]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RTVrZ-0005CN-CE for pgsql-bugs@postgresql.org; Thu, 24 Nov 2011 09:45:02 +0000 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id pAO9imQj065673 for ; Thu, 24 Nov 2011 09:44:48 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id pAO9imQB065672; Thu, 24 Nov 2011 09:44:48 GMT (envelope-from www) Date: Thu, 24 Nov 2011 09:44:48 GMT Message-Id: <201111240944.pAO9imQB065672@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #6306: sql parser: weird behaviour when selecting tablename.'name' from a table From: "" Content-Type: text/plain; charset=utf-8 X-Archive-Number: 201111/165 X-Sequence-Number: 31760 The following bug has been logged online: Bug reference: 6306 Logged by: Email address: karacho@kommespaeter.de PostgreSQL version: 8.4 Operating system: Windows XP Description: sql parser: weird behaviour when selecting tablename.'name' from a table Details: Selecting (nonexistant) column 'name' or 'varchar' results in an error. Selecting qualified nonexistant columns 'name' or 'varchar', you get the record as record. The view definition shows * casted to name or varchar. db=# create temp table tmp_table (a int, b text); CREATE TABLE db=# create view v_tmp as select name from tmp_table; FEHLER: Spalte »name« existiert nicht ZEILE 1: create view v_tmp as select name from tmp_table; ^ db=# create view v_tmp as select tmp_table.name, tmp_table.varchar from tmp_table; HINWEIS: Sicht »v_tmp« wird eine temporäre Sicht CREATE VIEW db=# \d v_tmp Sicht »pg_temp_1.v_tmp« Spalte | Typ | Attribute ---------+-------------------+----------- name | name | varchar | character varying | Sichtdefinition: SELECT tmp_table.*::name AS name, tmp_table.*::character varying AS "varchar" FROM tmp_table;