From 03795ffbc8e2f0c62422b6b9dc7b0fe1e6cdc0d9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 3 Jul 2010 04:03:27 +0000 Subject: [PATCH] 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. --- doc/src/sgml/datatype.sgml | 65 ++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 23 deletions(-) diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml index f02cf6c755..f11940652a 100644 --- a/doc/src/sgml/datatype.sgml +++ b/doc/src/sgml/datatype.sgml @@ -1,4 +1,4 @@ - + Data Types @@ -2453,7 +2453,7 @@ SELECT * FROM test1 WHERE a; 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 . @@ -2465,8 +2465,9 @@ SELECT * FROM test1 WHERE a; - Points are the fundamental two-dimensional building block for geometric types. - Values of type point are specified using the following syntax: + Points are the fundamental two-dimensional building block for geometric + types. Values of type point are specified using either of + the following syntaxes: ( x , y ) @@ -2476,6 +2477,10 @@ SELECT * FROM test1 WHERE a; where x and y are the respective coordinates as floating-point numbers. + + + Points are output using the first syntax. + @@ -2491,11 +2496,13 @@ SELECT * FROM test1 WHERE a; Line segments (lseg) are represented by pairs of points. - Values of type lseg are specified using the following syntax: + Values of type lseg are specified using any of the following + syntaxes: +[ ( x1 , y1 ) , ( x2 , y2 ) ] ( ( x1 , y1 ) , ( x2 , y2 ) ) - ( x1 , y1 ) , ( x2 , y2 ) + ( x1 , y1 ) , ( x2 , y2 ) x1 , y1 , x2 , y2 @@ -2505,6 +2512,10 @@ SELECT * FROM test1 WHERE a; (x2,y2) are the end points of the line segment. + + + Line segments are output using the first syntax. + @@ -2521,11 +2532,12 @@ SELECT * FROM test1 WHERE a; Boxes are represented by pairs of points that are opposite corners of the box. - Values of type box are specified using the following syntax: + Values of type box are specified using any of the following + syntaxes: ( ( x1 , y1 ) , ( x2 , y2 ) ) - ( x1 , y1 ) , ( x2 , y2 ) + ( x1 , y1 ) , ( x2 , y2 ) x1 , y1 , x2 , y2 @@ -2537,11 +2549,13 @@ SELECT * FROM test1 WHERE a; - 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. + + + + 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. @@ -2561,20 +2575,22 @@ SELECT * FROM test1 WHERE a; - Values of type path are specified using the following syntax: + Values of type path are specified using any of the following + syntaxes: -( ( x1 , y1 ) , ... , ( xn , yn ) ) [ ( x1 , y1 ) , ... , ( xn , yn ) ] - ( x1 , y1 ) , ... , ( xn , yn ) - ( x1 , y1 , ... , xn , yn ) - x1 , y1 , ... , xn , yn +( ( x1 , y1 ) , ... , ( xn , yn ) ) + ( x1 , y1 ) , ... , ( xn , yn ) + ( x1 , y1 , ... , xn , yn ) + x1 , y1 , ... , xn , yn where the points are the end points of the line segments comprising the path. Square brackets ([]) indicate an open path, while parentheses (()) indicate a - closed path. + closed path. When the outermost parentheses are omitted, as + in the third through fifth syntaxes, a closed path is assumed. @@ -2597,7 +2613,8 @@ SELECT * FROM test1 WHERE a; - Values of type polygon are specified using the following syntax: + Values of type polygon are specified using any of the + following syntaxes: ( ( x1 , y1 ) , ... , ( xn , yn ) ) @@ -2624,7 +2641,8 @@ SELECT * FROM test1 WHERE a; Circles are represented by a center point and a radius. - Values of type circle are specified using the following syntax: + Values of type circle are specified using any of the + following syntaxes: < ( x , y ) , r > @@ -2634,8 +2652,9 @@ SELECT * FROM test1 WHERE a; where - (x,y) - is the center and r is the radius of the circle. + (x,y) + is the center and r is the radius of the + circle. -- 2.39.5