pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Mysterious column "name"
4+ messages / 4 participants
[nested] [flat]

* Mysterious column "name"
@ 2011-08-04 14:50  Nikolay <wheelly@gmail.com>
  0 siblings, 2 replies; 4+ messages in thread

From: Nikolay @ 2011-08-04 14:50 UTC (permalink / raw)
  To: pgsql-sql

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 aaaaaa."name"
from yc_accounts aaaaaa
-----------------------------------------------------------------
name
name
-----------------------------------------------------------------
"(1154,81,testtter,"","","","","","","","","",donald22@126.com,""
-----------------------------------------------------------------

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.



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Mysterious column "name"
@ 2011-08-09 15:34  Oliveiros d'Azevedo Cristina <oliveiros.cristina@marktest.pt>
  parent: Nikolay <wheelly@gmail.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Oliveiros d'Azevedo Cristina @ 2011-08-09 15:34 UTC (permalink / raw)
  To: Nikolay <wheelly@gmail.com>; pgsql-sql

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" <wheelly@gmail.com>
To: <pgsql-sql@postgresql.org>
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 aaaaaa."name"
> from yc_accounts aaaaaa
> -----------------------------------------------------------------
> name
> name
> -----------------------------------------------------------------
> "(1154,81,testtter,"","","","","","","","","",donald22@126.com,""
> -----------------------------------------------------------------
> 
> 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 (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Mysterious column "name"
@ 2011-08-09 16:00  Steve Crawford <scrawford@pinpointresearch.com>
  parent: Oliveiros d'Azevedo Cristina <oliveiros.cristina@marktest.pt>
  0 siblings, 0 replies; 4+ messages in thread

From: Steve Crawford @ 2011-08-09 16:00 UTC (permalink / raw)
  To: Oliveiros d'Azevedo Cristina <oliveiros.cristina@marktest.pt>; +Cc: Nikolay <wheelly@gmail.com>; pgsql-sql

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Mysterious column "name"
@ 2011-08-09 16:04  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Nikolay <wheelly@gmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Tom Lane @ 2011-08-09 16:04 UTC (permalink / raw)
  To: Nikolay <wheelly@gmail.com>; +Cc: pgsql-sql

Nikolay <wheelly@gmail.com> 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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2011-08-09 16:04 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-08-04 14:50 Mysterious column "name" Nikolay <wheelly@gmail.com>
2011-08-09 15:34 ` Oliveiros d'Azevedo Cristina <oliveiros.cristina@marktest.pt>
2011-08-09 16:00   ` Steve Crawford <scrawford@pinpointresearch.com>
2011-08-09 16:04 ` Tom Lane <tgl@sss.pgh.pa.us>

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