BUG #2017: column labels ignored on selects from views - Mailing list pgsql-bugs

From Jolly Chen
Subject BUG #2017: column labels ignored on selects from views
Date
Msg-id 20051103000832.D7C76F117D@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #2017: column labels ignored on selects from views  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #2017: column labels ignored on selects from views  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2017
Logged by:          Jolly Chen
Email address:      jolly@gauntletsystems.com
PostgreSQL version: 8.1RC1
Operating system:   Mac OS X 10.4.3
Description:        column labels ignored on selects from views
Details:

Note how the column labels work for v2 but not for v1. This problem causes
columns to be mistakenly missing in JDBC ResultSets.


testdb=# create table foo (f1 integer);
CREATE TABLE
testdb=# insert into foo values (1);
INSERT 0 1
testdb=# insert into foo values (2);
INSERT 0 1
testdb=# create view v1 as select sum(f1) as sum from foo;
CREATE VIEW
testdb=# select * from v1;
 sum
-----
   3
(1 row)

testdb=# select sum as s from v1;
 sum
-----
   3
(1 row)

testdb=# create view v2 as select f1*10 as tenX from foo;
CREATE VIEW
testdb=# select * from v2;
 tenx
------
   10
   20
(2 rows)

testdb=# select tenX as t from v2;
 t
----
 10
 20
(2 rows)

testdb=# select version();
                                                                    version

----------------------------------------------------------------------------
-------------------------------------------------------------------
 PostgreSQL 8.1RC1 on powerpc-apple-darwin8.3.0, compiled by GCC
powerpc-apple-darwin8-gcc-4.0.0 (GCC) 4.0.0 (Apple Computer, Inc. build
5026)(1 row)

testdb=#

pgsql-bugs by date:

Previous
From: "Bernhard Weisshuhn"
Date:
Subject: BUG #2018: segfaults with some german errormessages
Next
From: Ivan
Date:
Subject: Re: pg_dumpall bug & feature request