aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-08-08 14:29:07 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-08-08 14:29:07 +0000
commitd176fad58059b7e652998a37da5cb9788ec7ea40 (patch)
tree99b6d3edb00aaf369b02a274c36f4257bf3e236c /doc/src
parentf84002176f3f4d52fb1dad13a725967ca4974853 (diff)
downloadpostgresql-d176fad58059b7e652998a37da5cb9788ec7ea40.tar.gz
postgresql-d176fad58059b7e652998a37da5cb9788ec7ea40.zip
Some improvements in geometric-operators documentation.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml34
1 files changed, 25 insertions, 9 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index aed47db79b9..8d722a91853 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1,5 +1,5 @@
<!--
-$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.108 2002/08/06 05:40:44 ishii Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.109 2002/08/08 14:29:07 tgl Exp $
PostgreSQL documentation
-->
@@ -3868,7 +3868,7 @@ SELECT TIMESTAMP 'now';
</row>
<row>
<entry> # </entry>
- <entry>Number of points in polygon</entry>
+ <entry>Number of points in path or polygon</entry>
<entry><literal># '((1,0),(0,1),(-1,0))'</literal></entry>
</row>
<row>
@@ -4026,6 +4026,18 @@ SELECT TIMESTAMP 'now';
<entry><literal>length(path '((-1,0),(1,0))')</literal></entry>
</row>
<row>
+ <entry><function>npoints</function>(path)</entry>
+ <entry><type>integer</type></entry>
+ <entry>number of points</entry>
+ <entry><literal>npoints(path '[(0,0),(1,1),(2,0)]')</literal></entry>
+ </row>
+ <row>
+ <entry><function>npoints</function>(polygon)</entry>
+ <entry><type>integer</type></entry>
+ <entry>number of points</entry>
+ <entry><literal>npoints(polygon '((1,1),(0,0))')</literal></entry>
+ </row>
+ <row>
<entry><function>pclose</function>(path)</entry>
<entry><type>path</type></entry>
<entry>convert path to closed</entry>
@@ -4041,12 +4053,6 @@ SELECT TIMESTAMP 'now';
</row>
]]>
<row>
- <entry><function>npoint</function>(path)</entry>
- <entry><type>integer</type></entry>
- <entry>number of points</entry>
- <entry><literal>npoints(path '[(0,0),(1,1),(2,0)]')</literal></entry>
- </row>
- <row>
<entry><function>popen</function>(path)</entry>
<entry><type>path</type></entry>
<entry>convert path to open path</entry>
@@ -4150,7 +4156,7 @@ SELECT TIMESTAMP 'now';
<row>
<entry><function>polygon</function>(<type>box</type>)</entry>
<entry><type>polygon</type></entry>
- <entry>12 point polygon</entry>
+ <entry>4-point polygon</entry>
<entry><literal>polygon(box '((0,0),(1,1))')</literal></entry>
</row>
<row>
@@ -4175,6 +4181,16 @@ SELECT TIMESTAMP 'now';
</tgroup>
</table>
+ <para>
+ It is possible to access the two component numbers of a <type>point</>
+ as though it were an array with subscripts 0,1. For example, if
+ <literal>t.p</> is a <type>point</> column then
+ <literal>SELECT p[0] FROM t</> retrieves the X coordinate;
+ <literal>UPDATE t SET p[1] = ...</> changes the Y coordinate.
+ In the same way, a <type>box</> or an <type>lseg</> may be treated
+ as an array of two <type>point</>s.
+ </para>
+
</sect1>