[SQL] Mysterious column "name"

2011-08-09 Thread Nikolay

Good day!

I found one strange results for sql-query.

create table testtable (
f1 int,
f2 int
);

insert into testtable(f1, f2) values(1, 100);

select testtable.* from testtable; // it is ok

select testtable from testtable; // it is ok

select testtable.name from testtable; // returns strange result.
-
name
name
-
"(1,100)"
-
no error message about nonexistent column.
Result is similar to second variant, but pgAdmin3 shows not full record.

for long table the result is truncated
select aa."name"
from yc_accounts aa
-
name
name
-
"(1154,81,testtter,"","","","","","","","","",[email protected],""
-

The same results on two servers.
PostgreSQL 9.0.4 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real 
(Debian 4.4.5-8) 4.4.5, 64-bit


PostgreSQL 9.0.4 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.5.real 
(Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2, 64-bit


Is it a feature or a bug? I didn't found information in documentation 
about this.



Best regards.
Nikolay.

--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Mysterious column "name"

2011-08-09 Thread Oliveiros d'Azevedo Cristina

Strange...

Tables have hidden columns but AFAIK, "name" is not one of them...

http://www.postgresql.org/docs/9.0/interactive/ddl-system-columns.html

Best,
Oliveiros

- Original Message - 
From: "Nikolay" 

To: 
Sent: Thursday, August 04, 2011 3:50 PM
Subject: [SQL] Mysterious column "name"



Good day!

I found one strange results for sql-query.

create table testtable (
f1 int,
f2 int
);

insert into testtable(f1, f2) values(1, 100);

select testtable.* from testtable; // it is ok

select testtable from testtable; // it is ok

select testtable.name from testtable; // returns strange result.
-
name
name
-
"(1,100)"
-
no error message about nonexistent column.
Result is similar to second variant, but pgAdmin3 shows not full record.

for long table the result is truncated
select aa."name"
from yc_accounts aa
-
name
name
-
"(1154,81,testtter,"","","","","","","","","",[email protected],""
-

The same results on two servers.
PostgreSQL 9.0.4 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real 
(Debian 4.4.5-8) 4.4.5, 64-bit


PostgreSQL 9.0.4 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.5.real 
(Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2, 64-bit


Is it a feature or a bug? I didn't found information in documentation 
about this.



Best regards.
Nikolay.

--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Mysterious column "name"

2011-08-09 Thread Steve Crawford

On 08/09/2011 08:34 AM, Oliveiros d'Azevedo Cristina wrote:

Strange...

Tables have hidden columns but AFAIK, "name" is not one of them...

http://www.postgresql.org/docs/9.0/interactive/ddl-system-columns.html

...


Good day!

I found one strange results for sql-query.

create table testtable (
f1 int,
f2 int
);

insert into testtable(f1, f2) values(1, 100);

select testtable.* from testtable; // it is ok

select testtable from testtable; // it is ok

select testtable.name from testtable; // returns strange result.
-
name
name
-
"(1,100)"
-
no error message about nonexistent column.
Result is similar to second variant, but pgAdmin3 shows not full record.
...


See http://www.postgresql.org/docs/9.0/static/rowtypes.html on composite 
data types and scroll to section 8.15.3.


Cheers,
Steve

--
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql


Re: [SQL] Mysterious column "name"

2011-08-09 Thread Tom Lane
Nikolay  writes:
> select testtable.name from testtable; // returns strange result.

See
http://archives.postgresql.org/pgsql-bugs/2010-10/msg00269.php

This will change in 9.1:
http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=543d22fc7

regards, tom lane

-- 
Sent via pgsql-sql mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql