public inbox for [email protected]
help / color / mirror / Atom feedFrom: =?KOI8-R?B?98nL1M/SIPfJ08zPws/Lz9c=?= <[email protected]>
To: PostgreSQL-documentation <[email protected]>
Subject: Undocumented trick in SELECT?
Date: Sun, 4 Apr 2010 17:01:28 +0400
Message-ID: <[email protected]> (raw)
I'm sorry, but I have not found such construction into documentation:
SELECT tablename FROM tablename;
http://www.postgresql.org/docs/8.4/static/queries-overview.html
say:
[WITH with_queries] SELECT select_list FROM table_expression
[sort_specification]
http://www.postgresql.org/docs/8.4/static/queries-select-lists.html
say:
"The select list determines which columns of the intermediate table are
actually output."
But, table name is not a column.
Reproduce:
tmp=# create table tmp(id SERIAL, name VARCHAR(10));
NOTICE: CREATE TABLE will create implicit sequence "tmp_id_seq" for serial
column "tmp.id"
CREATE TABLE
tmp=# insert into tmp (name) values('John');
INSERT 0 1
tmp=# insert into tmp (name) values('Pol');
INSERT 0 1
tmp=# insert into tmp (name) values('Martin');
INSERT 0 1
tmp=# select tmp from tmp;
tmp
------------
(1,John)
(2,Pol)
(3,Martin)
(3 rows)
What is this? Is this undocumented or am I bad looked in the documentation?
With best wishes,
Victor Vislobokov
St.Peterburg. Russia
view thread (2+ messages) latest in thread
reply
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: Undocumented trick in SELECT?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox