Skip to content

Commit 5932915

Browse files
committed
Add a specific example of parenthesizing when extracting a field of a
composite column. Might help cut down on future questions...
1 parent dea81a6 commit 5932915

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

doc/src/sgml/syntax.sgml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.125 2008/10/29 14:35:04 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.126 2008/12/09 20:52:03 tgl Exp $ -->
22

33
<chapter id="sql-syntax">
44
<title>SQL Syntax</title>
@@ -1387,7 +1387,18 @@ $1.somecolumn
13871387
</programlisting>
13881388

13891389
(Thus, a qualified column reference is actually just a special case
1390-
of the field selection syntax.)
1390+
of the field selection syntax.) An important special case is
1391+
extracting a field from a table column that is of a composite type:
1392+
1393+
<programlisting>
1394+
(compositecol).somefield
1395+
(mytable.compositecol).somefield
1396+
</programlisting>
1397+
1398+
The parentheses are required here to show that
1399+
<structfield>compositecol</> is a column name not a table name,
1400+
or that <structname>mytable</> is a table name not a schema name
1401+
in the second case.
13911402
</para>
13921403
</sect2>
13931404

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy