aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2013-10-09 01:09:18 -0400
committerPeter Eisentraut <peter_e@gmx.net>2013-10-09 22:34:38 -0400
commit261c7d4b653bc3e44c31fd456d94f292caa50d8f (patch)
treec908259140d328054336afb57deb1afdc565f534 /doc/src
parent0ac5e5a7e152504c71ce2168acc9cef7fde7893c (diff)
downloadpostgresql-261c7d4b653bc3e44c31fd456d94f292caa50d8f.tar.gz
postgresql-261c7d4b653bc3e44c31fd456d94f292caa50d8f.zip
Revive line type
Change the input/output format to {A,B,C}, to match the internal representation. Complete the implementations of line_in, line_out, line_recv, line_send. Remove comments and error messages about the line type not being implemented. Add regression tests for existing line operators and functions. Reviewed-by: rui hua <365507506hua@gmail.com> Reviewed-by: Álvaro Herrera <alvherre@2ndquadrant.com> Reviewed-by: Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/datatype.sgml42
-rw-r--r--doc/src/sgml/func.sgml6
2 files changed, 42 insertions, 6 deletions
diff --git a/doc/src/sgml/datatype.sgml b/doc/src/sgml/datatype.sgml
index 87668ea0c1c..07f0385d80d 100644
--- a/doc/src/sgml/datatype.sgml
+++ b/doc/src/sgml/datatype.sgml
@@ -3051,9 +3051,7 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
<para>
Geometric data types represent two-dimensional spatial
objects. <xref linkend="datatype-geo-table"> shows the geometric
- types available in <productname>PostgreSQL</productname>. The
- most fundamental type, the point, forms the basis for all of the
- other types.
+ types available in <productname>PostgreSQL</productname>.
</para>
<table id="datatype-geo-table">
@@ -3063,8 +3061,8 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
<row>
<entry>Name</entry>
<entry>Storage Size</entry>
- <entry>Representation</entry>
<entry>Description</entry>
+ <entry>Representation</entry>
</row>
</thead>
<tbody>
@@ -3077,8 +3075,8 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
<row>
<entry><type>line</type></entry>
<entry>32 bytes</entry>
- <entry>Infinite line (not fully implemented)</entry>
- <entry>((x1,y1),(x2,y2))</entry>
+ <entry>Infinite line</entry>
+ <entry>{A,B,C}</entry>
</row>
<row>
<entry><type>lseg</type></entry>
@@ -3153,6 +3151,38 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
</sect2>
<sect2>
+ <title>Lines</title>
+
+ <indexterm>
+ <primary>line</primary>
+ </indexterm>
+
+ <para>
+ Lines (<type>line</type>) are represented by the linear equation Ax + By
+ + C = 0, where A and B are not both zero. Values of
+ type <type>line</type> is input and output in the following form:
+<synopsis>
+{ <replaceable>A</replaceable>, <replaceable>B</replaceable>, <replaceable>C</replaceable> }
+</synopsis>
+
+ Alternatively, any of the following forms can be used for input:
+
+<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>
+
+ where
+ <literal>(<replaceable>x1</replaceable>,<replaceable>y1</replaceable>)</literal>
+ and
+ <literal>(<replaceable>x2</replaceable>,<replaceable>y2</replaceable>)</literal>
+ are two (different) points on the line.
+ </para>
+ </sect2>
+
+ <sect2>
<title>Line Segments</title>
<indexterm>
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index c3090dd2b9f..be7b00b1f32 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -8123,6 +8123,12 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
<entry><literal>circle(polygon '((0,0),(1,1),(2,0))')</literal></entry>
</row>
<row>
+ <entry><literal><function>line(<type>point</type>, <type>point</type>)</function></literal></entry>
+ <entry><type>line</type></entry>
+ <entry>points to line</entry>
+ <entry><literal>line(point '(-1,0)', point '(1,0)')</literal></entry>
+ </row>
+ <row>
<entry>
<indexterm>
<primary>lseg</primary>