11<!--
2- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.151 2004/11/27 21:27:05 petere Exp $
2+ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.152 2004/12/23 05:37:39 tgl Exp $
33-->
44
55 <chapter id="datatype">
@@ -22,9 +22,8 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.151 2004/11/27 21:27:05 petere
2222 </para>
2323
2424 <para>
25- <xref linkend="datatype-table"> shows all built-in general-purpose data types.
26- Most of the alternative names
27- listed in the
25+ <xref linkend="datatype-table"> shows all the built-in general-purpose data
26+ types. Most of the alternative names listed in the
2827 <quote>Aliases</quote> column are the names used internally by
2928 <productname>PostgreSQL</productname> for historical reasons. In
3029 addition, some internally used or deprecated types are available,
@@ -82,7 +81,7 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.151 2004/11/27 21:27:05 petere
8281 <row>
8382 <entry><type>bytea</type></entry>
8483 <entry></entry>
85- <entry>binary data</entry>
84+ <entry>binary data (<quote>byte array</>) </entry>
8685 </row>
8786
8887 <row>
@@ -142,7 +141,7 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.151 2004/11/27 21:27:05 petere
142141 <row>
143142 <entry><type>line</type></entry>
144143 <entry></entry>
145- <entry>infinite line in the plane (not fully implemented) </entry>
144+ <entry>infinite line in the plane</entry>
146145 </row>
147146
148147 <row>
@@ -168,13 +167,13 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.151 2004/11/27 21:27:05 petere
168167 <replaceable>s</replaceable>) ]</type></entry>
169168 <entry><type>decimal [ (<replaceable>p</replaceable>,
170169 <replaceable>s</replaceable>) ]</type></entry>
171- <entry>exact numericwith selectable precision</entry>
170+ <entry>exact numericof selectable precision</entry>
172171 </row>
173172
174173 <row>
175174 <entry><type>path</type></entry>
176175 <entry></entry>
177- <entry>open or closed geometric path in the plane</entry>
176+ <entry>geometric path in the plane</entry>
178177 </row>
179178
180179 <row>
@@ -227,7 +226,7 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.151 2004/11/27 21:27:05 petere
227226
228227 <row>
229228 <entry><type>timestamp [ (<replaceable>p</replaceable>) ] [ without time zone ]</type></entry>
230- <entry><type></type>< /entry>
229+ <entry></entry>
231230 <entry>date and time</entry>
232231 </row>
233232
@@ -259,22 +258,14 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.151 2004/11/27 21:27:05 petere
259258 Each data type has an external representation determined by its input
260259 and output functions. Many of the built-in types have
261260 obvious external formats. However, several types are either unique
262- to <productname>PostgreSQL</productname>, such asopen and closed
261+ to <productname>PostgreSQL</productname>, such asgeometric
263262 paths, or have several possibilities for formats, such as the date
264263 and time types.
265264 Some of the input and output functions are not invertible. That is,
266265 the result of an output function may lose accuracy when compared to
267266 the original input.
268267 </para>
269268
270- <para>
271- Some of the operators and functions (e.g.,
272- addition and multiplication) do not perform run-time error-checking in the
273- interests of improving execution speed.
274- On some systems, for example, the numeric operators for some data types may
275- silently cause underflow or overflow.
276- </para>
277-
278269 <sect1 id="datatype-numeric">
279270 <title>Numeric Types</title>
280271
@@ -285,7 +276,7 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.151 2004/11/27 21:27:05 petere
285276
286277 <para>
287278 Numeric types consist of two-, four-, and eight-byte integers,
288- four- and eight-byte floating-point numbers, andfixed -precision
279+ four- and eight-byte floating-point numbers, andselectable -precision
289280 decimals. <xref linkend="datatype-numeric-table"> lists the
290281 available types.
291282 </para>
@@ -755,7 +746,7 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (
755746 created by reloading a dump from a pre-7.3 database; the dump
756747 file does not contain the information needed to establish the
757748 dependency link.) Furthermore, this dependency between sequence
758- and column is made only for the <type>serial</> column itself; if
749+ and column is made only for the <type>serial</> column itself. If
759750 any other columns reference the sequence (perhaps by manually
760751 calling the <function>nextval</> function), they will be broken
761752 if the sequence is removed. Using a <type>serial</> column's sequence
@@ -916,7 +907,7 @@ CREATE TABLE <replaceable class="parameter">tablename</replaceable> (
916907 varying(<replaceable>n</>)</type> and
917908 <type>character(<replaceable>n</>)</type>, respectively.
918909 <type>character</type> without length specifier is equivalent to
919- <type>character(1)</type>; if <type>character varying</type> is used
910+ <type>character(1)</type>. If <type>character varying</type> is used
920911 without length specifier, the type accepts strings of any size. The
921912 latter is a <productname>PostgreSQL</> extension.
922913 </para>
@@ -1114,8 +1105,8 @@ SELECT b, char_length(b) FROM test2;
11141105 literal in an <acronym>SQL</acronym> statement. In general, to
11151106 escape an octet, it is converted into the three-digit octal number
11161107 equivalent of its decimal octet value, and preceded by two
1117- backslashes. <xref linkend="datatype-binary-sqlesc">contains the
1118- characterswhich must be escaped, and gives the alternate escape
1108+ backslashes. <xref linkend="datatype-binary-sqlesc">shows the
1109+ charactersthat must be escaped, and gives the alternate escape
11191110 sequences where applicable.
11201111 </para>
11211112
@@ -2429,7 +2420,7 @@ SELECT * FROM test1 WHERE a;
24292420 <para>
24302421 Boxes are represented by pairs of points that are opposite
24312422 corners of the box.
2432- Values of type <type>box</type>is specified using the following syntax:
2423+ Values of type <type>box</type>are specified using the following syntax:
24332424
24342425<synopsis>
24352426( ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> ) )
@@ -2441,15 +2432,15 @@ SELECT * FROM test1 WHERE a;
24412432 <literal>(<replaceable>x1</replaceable>,<replaceable>y1</replaceable>)</literal>
24422433 and
24432434 <literal>(<replaceable>x2</replaceable>,<replaceable>y2</replaceable>)</literal>
2444- arethe opposite corners of the box.
2435+ areany two opposite corners of the box.
24452436 </para>
24462437
24472438 <para>
24482439 Boxes are output using the first syntax.
24492440 The corners are reordered on input to store
24502441 the upper right corner, then the lower left corner.
24512442 Other corners of the box can be entered, but the lower
2452- left and upper right corners are determined from the input and stored corners .
2443+ left and upper right corners are determined from the input and stored.
24532444 </para>
24542445 </sect2>
24552446
@@ -2461,18 +2452,11 @@ SELECT * FROM test1 WHERE a;
24612452 </indexterm>
24622453
24632454 <para>
2464- Paths are represented byconnected sets of points. Paths can be
2455+ Paths are represented bylists of connected points. Paths can be
24652456 <firstterm>open</firstterm>, where
2466- the first and last points in the set are not connected, and <firstterm>closed</firstterm>,
2467- where the first and last point are connected. The functions
2468- <function>popen(<replaceable>p</>)</function>
2469- and
2470- <function>pclose(<replaceable>p</>)</function>
2471- are supplied to force a path to be open or closed, and the functions
2472- <function>isopen(<replaceable>p</>)</function>
2473- and
2474- <function>isclosed(<replaceable>p</>)</function>
2475- are supplied to test for either type in an expression.
2457+ the first and last points in the list are not connected, or
2458+ <firstterm>closed</firstterm>,
2459+ where the first and last points are connected.
24762460 </para>
24772461
24782462 <para>
@@ -2505,7 +2489,8 @@ SELECT * FROM test1 WHERE a;
25052489 </indexterm>
25062490
25072491 <para>
2508- Polygons are represented by sets of points. Polygons should probably be
2492+ Polygons are represented by lists of points (the vertexes of the
2493+ polygon). Polygons should probably be
25092494 considered equivalent to closed paths, but are stored differently
25102495 and have their own set of support routines.
25112496 </para>
@@ -2569,8 +2554,9 @@ SELECT * FROM test1 WHERE a;
25692554
25702555 <para>
25712556 <productname>PostgreSQL</> offers data types to store IPv4, IPv6, and MAC
2572- addresses, shown in <xref linkend="datatype-net-types-table">. It
2573- is preferable to use these types over plain text types, because
2557+ addresses, as shown in <xref linkend="datatype-net-types-table">. It
2558+ is preferable to use these types instead of plain text types to store
2559+ network addresses, because
25742560 these types offer input error checking and several specialized
25752561 operators and functions.
25762562 </para>
@@ -2590,7 +2576,7 @@ SELECT * FROM test1 WHERE a;
25902576 <row>
25912577 <entry><type>cidr</type></entry>
25922578 <entry>12 or 24 bytes</entry>
2593- <entry>IPv4or IPv6 networks</entry>
2579+ <entry>IPv4and IPv6 networks</entry>
25942580 </row>
25952581
25962582 <row>
@@ -2631,7 +2617,7 @@ SELECT * FROM test1 WHERE a;
26312617 the host address represent the network address (the
26322618 <quote>netmask</quote>). If the netmask is 32 and the address is IPv4,
26332619 then the value does not indicate a subnet, only a single host.
2634- In IPv6, the address length is 128 bits, so 128 bitswill specify a
2620+ In IPv6, the address length is 128 bits, so 128 bits specify a
26352621 unique host address. Note that if you
26362622 want to accept networks only, you should use the
26372623 <type>cidr</type> type rather than <type>inet</type>.
@@ -2647,7 +2633,7 @@ SELECT * FROM test1 WHERE a;
26472633 is the number of bits in the netmask. If the
26482634 <replaceable class="parameter">/y</replaceable>
26492635 part is left off, then the
2650- netmask is 32 for IPv4 and 128 for IPv6,and the value represents
2636+ netmask is 32 for IPv4 and 128 for IPv6,so the value represents
26512637 just a single host. On display, the
26522638 <replaceable class="parameter">/y</replaceable>
26532639 portion is suppressed if the netmask specifies a single host.
@@ -2824,7 +2810,7 @@ SELECT * FROM test1 WHERE a;
28242810 which would all specify the same
28252811 address. Upper and lower case is accepted for the digits
28262812 <literal>a</> through <literal>f</>. Output is always in the
2827- last of theshown forms.
2813+ last of the forms shown .
28282814 </para>
28292815
28302816 <para>