aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-12-09 20:52:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-12-09 20:52:03 +0000
commit5932915fef5a3fce0267de390650fd98b4a3d824 (patch)
treef2a21790c8dda77ed30efc9857d13a924df47945
parentdea81a6cf620528e6c17e9973b32b54e0076cf06 (diff)
downloadpostgresql-5932915fef5a3fce0267de390650fd98b4a3d824.tar.gz
postgresql-5932915fef5a3fce0267de390650fd98b4a3d824.zip
Add a specific example of parenthesizing when extracting a field of a
composite column. Might help cut down on future questions...
-rw-r--r--doc/src/sgml/syntax.sgml15
1 files changed, 13 insertions, 2 deletions
diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml
index 90aa3b6c9b4..cca44794340 100644
--- a/doc/src/sgml/syntax.sgml
+++ b/doc/src/sgml/syntax.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.125 2008/10/29 14:35:04 momjian Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/syntax.sgml,v 1.126 2008/12/09 20:52:03 tgl Exp $ -->
<chapter id="sql-syntax">
<title>SQL Syntax</title>
@@ -1387,7 +1387,18 @@ $1.somecolumn
</programlisting>
(Thus, a qualified column reference is actually just a special case
- of the field selection syntax.)
+ of the field selection syntax.) An important special case is
+ extracting a field from a table column that is of a composite type:
+
+<programlisting>
+(compositecol).somefield
+(mytable.compositecol).somefield
+</programlisting>
+
+ The parentheses are required here to show that
+ <structfield>compositecol</> is a column name not a table name,
+ or that <structname>mytable</> is a table name not a schema name
+ in the second case.
</para>
</sect2>