aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-07-03 04:03:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-07-03 04:03:33 +0000
commit4d242bb56d8294747cdbc06124baae375a203604 (patch)
tree064b929f0c44de60c8cf208ad47e802c9c5df379
parentb525073970c8df06aad71de382d5f6da276ee3a9 (diff)
downloadpostgresql-4d242bb56d8294747cdbc06124baae375a203604.tar.gz
postgresql-4d242bb56d8294747cdbc06124baae375a203604.zip
Fix assorted misstatements and poor wording in the descriptions of the I/O
formats for geometric types. Per bug #5536 from Jon Strait, and my own testing. Back-patch to all supported branches, since this doco has been wrong right along -- we certainly haven't changed the I/O behavior of these types in many years.
-rw-r--r--doc/src/sgml/datatype.sgml65
1 files changed, 42 insertions, 23 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 68e760dd05a..0fdc8e7e51a 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.163.2.5 2008/01/02 19:53:19 mha Exp $
+$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.163.2.6 2010/07/03 04:03:33 tgl Exp $
-->
<chapter id="datatype">
@@ -2379,7 +2379,7 @@ SELECT * FROM test1 WHERE a;
<para>
A rich set of functions and operators is available to perform various geometric
- operations such as scaling, translation, rotation, and determining
+ operations such as scaling, translation, rotation, and determining
intersections. They are explained in <xref linkend="functions-geometry">.
</para>
@@ -2391,8 +2391,9 @@ SELECT * FROM test1 WHERE a;
</indexterm>
<para>
- Points are the fundamental two-dimensional building block for geometric types.
- Values of type <type>point</type> are specified using the following syntax:
+ Points are the fundamental two-dimensional building block for geometric
+ types. Values of type <type>point</type> are specified using either of
+ the following syntaxes:
<synopsis>
( <replaceable>x</replaceable> , <replaceable>y</replaceable> )
@@ -2402,6 +2403,10 @@ SELECT * FROM test1 WHERE a;
where <replaceable>x</> and <replaceable>y</> are the respective
coordinates as floating-point numbers.
</para>
+
+ <para>
+ Points are output using the first syntax.
+ </para>
</sect2>
<sect2>
@@ -2417,11 +2422,13 @@ SELECT * FROM test1 WHERE a;
<para>
Line segments (<type>lseg</type>) are represented by pairs of points.
- Values of type <type>lseg</type> are specified using the following syntax:
+ Values of type <type>lseg</type> are specified using any of the following
+ syntaxes:
<synopsis>
+[ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> ) ]
( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> ) )
- ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> )
+ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> )
<replaceable>x1</replaceable> , <replaceable>y1</replaceable> , <replaceable>x2</replaceable> , <replaceable>y2</replaceable>
</synopsis>
@@ -2431,6 +2438,10 @@ SELECT * FROM test1 WHERE a;
<literal>(<replaceable>x2</replaceable>,<replaceable>y2</replaceable>)</literal>
are the end points of the line segment.
</para>
+
+ <para>
+ Line segments are output using the first syntax.
+ </para>
</sect2>
<sect2>
@@ -2447,11 +2458,12 @@ SELECT * FROM test1 WHERE a;
<para>
Boxes are represented by pairs of points that are opposite
corners of the box.
- Values of type <type>box</type> are specified using the following syntax:
+ Values of type <type>box</type> are specified using any of the following
+ syntaxes:
<synopsis>
( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> ) )
- ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> )
+ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> )
<replaceable>x1</replaceable> , <replaceable>y1</replaceable> , <replaceable>x2</replaceable> , <replaceable>y2</replaceable>
</synopsis>
@@ -2463,11 +2475,13 @@ SELECT * FROM test1 WHERE a;
</para>
<para>
- Boxes are output using the first syntax.
- The corners are reordered on input to store
- the upper right corner, then the lower left corner.
- Other corners of the box can be entered, but the lower
- left and upper right corners are determined from the input and stored.
+ Boxes are output using the second syntax.
+ </para>
+
+ <para>
+ Any two opposite corners can be supplied on input, but the values
+ will be reordered as needed to store the
+ upper right and lower left corners, in that order.
</para>
</sect2>
@@ -2487,20 +2501,22 @@ SELECT * FROM test1 WHERE a;
</para>
<para>
- Values of type <type>path</type> are specified using the following syntax:
+ Values of type <type>path</type> are specified using any of the following
+ syntaxes:
<synopsis>
-( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> ) )
[ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> ) ]
- ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> )
- ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> , ... , <replaceable>xn</replaceable> , <replaceable>yn</replaceable> )
- <replaceable>x1</replaceable> , <replaceable>y1</replaceable> , ... , <replaceable>xn</replaceable> , <replaceable>yn</replaceable>
+( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> ) )
+ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> )
+ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> , ... , <replaceable>xn</replaceable> , <replaceable>yn</replaceable> )
+ <replaceable>x1</replaceable> , <replaceable>y1</replaceable> , ... , <replaceable>xn</replaceable> , <replaceable>yn</replaceable>
</synopsis>
where the points are the end points of the line segments
comprising the path. Square brackets (<literal>[]</>) indicate
an open path, while parentheses (<literal>()</>) indicate a
- closed path.
+ closed path. When the outermost parentheses are omitted, as
+ in the third through fifth syntaxes, a closed path is assumed.
</para>
<para>
@@ -2523,7 +2539,8 @@ SELECT * FROM test1 WHERE a;
</para>
<para>
- Values of type <type>polygon</type> are specified using the following syntax:
+ Values of type <type>polygon</type> are specified using any of the
+ following syntaxes:
<synopsis>
( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ... , ( <replaceable>xn</replaceable> , <replaceable>yn</replaceable> ) )
@@ -2550,7 +2567,8 @@ SELECT * FROM test1 WHERE a;
<para>
Circles are represented by a center point and a radius.
- Values of type <type>circle</type> are specified using the following syntax:
+ Values of type <type>circle</type> are specified using any of the
+ following syntaxes:
<synopsis>
&lt; ( <replaceable>x</replaceable> , <replaceable>y</replaceable> ) , <replaceable>r</replaceable> &gt;
@@ -2560,8 +2578,9 @@ SELECT * FROM test1 WHERE a;
</synopsis>
where
- <literal>(<replaceable>x</replaceable>,<replaceable>y</replaceable>)</literal>
- is the center and <replaceable>r</replaceable> is the radius of the circle.
+ <literal>(<replaceable>x</replaceable>,<replaceable>y</replaceable>)</>
+ is the center and <replaceable>r</replaceable> is the radius of the
+ circle.
</para>
<para>