pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedVALUES lists aliases
2+ messages / 2 participants
[nested] [flat]
* VALUES lists aliases
@ 2013-05-21 16:18 Greg Smith <greg@2ndQuadrant.com>
2013-06-07 01:04 ` Re: VALUES lists aliases Peter Eisentraut <peter_e@gmx.net>
0 siblings, 1 reply; 2+ messages in thread
From: Greg Smith @ 2013-05-21 16:18 UTC (permalink / raw)
To: pgsql-docs
Next from the stream of doc comments, someone points out that if you
read http://www.postgresql.org/docs/current/static/queries-values.html a
beginner may not understand just what " table alias list" means. If you
start at the beginning of the chapter it makes more sense, but it isn't
necessarily obvious even then.
Easiest fix is to demonstrate this by example, so that's what the
attached patch adds. There was an example of this approach in the full
documentation of VALUES already, but I felt that one was too complicated
for a tutorial section.
--
Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.com
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
Attachments:
alias-list-example.patch (text/plain, 660B) download
diff --git a/doc/src/sgml/queries.sgml b/doc/src/sgml/queries.sgml
index d7b0d73..cf477c7 100644
--- a/doc/src/sgml/queries.sgml
+++ b/doc/src/sgml/queries.sgml
@@ -1609,7 +1609,16 @@ SELECT 3, 'three';
<literal>VALUES</> table. The column names are not specified by the
SQL standard and different database systems do it differently, so
it's usually better to override the default names with a table alias
- list.
+ list:
+<programlisting>
+=> SELECT * FROM (VALUES (1, 'one'), (2, 'two'), (3, 'three')) AS t (num,letter);
+ num | letter
+-----+--------
+ 1 | one
+ 2 | two
+ 3 | three
+(3 rows)
+</programlisting>
</para>
<para>
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: VALUES lists aliases
2013-05-21 16:18 VALUES lists aliases Greg Smith <greg@2ndQuadrant.com>
@ 2013-06-07 01:04 ` Peter Eisentraut <peter_e@gmx.net>
0 siblings, 0 replies; 2+ messages in thread
From: Peter Eisentraut @ 2013-06-07 01:04 UTC (permalink / raw)
To: Greg Smith <greg@2ndQuadrant.com>; +Cc: pgsql-docs
On Tue, 2013-05-21 at 12:18 -0400, Greg Smith wrote:
> Next from the stream of doc comments, someone points out that if you
> read http://www.postgresql.org/docs/current/static/queries-values.html a
> beginner may not understand just what " table alias list" means. If you
> start at the beginning of the chapter it makes more sense, but it isn't
> necessarily obvious even then.
>
> Easiest fix is to demonstrate this by example, so that's what the
> attached patch adds. There was an example of this approach in the full
> documentation of VALUES already, but I felt that one was too complicated
> for a tutorial section.
committed
--
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2013-06-07 01:04 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-05-21 16:18 VALUES lists aliases Greg Smith <greg@2ndQuadrant.com>
2013-06-07 01:04 ` Peter Eisentraut <peter_e@gmx.net>
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