Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6889537c
Commit
6889537c
authored
Jan 08, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some small docs improvements motivated by reading the comments for the 7.4
7.4 interactive docs.
parent
cb6eab78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
814 additions
and
780 deletions
+814
-780
doc/src/sgml/datatype.sgml
doc/src/sgml/datatype.sgml
+60
-28
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+754
-752
No files found.
doc/src/sgml/datatype.sgml
View file @
6889537c
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.15
2 2004/12/23 05:37:39
tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.15
3 2005/01/08 05:19:18
tgl Exp $
-->
-->
<chapter id="datatype">
<chapter id="datatype">
...
@@ -446,9 +446,9 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.152 2004/12/23 05:37:39 tgl Ex
...
@@ -446,9 +446,9 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.152 2004/12/23 05:37:39 tgl Ex
The type <type>numeric</type> can store numbers with up to 1000
The type <type>numeric</type> can store numbers with up to 1000
digits of precision and perform calculations exactly. It is
digits of precision and perform calculations exactly. It is
especially recommended for storing monetary amounts and other
especially recommended for storing monetary amounts and other
quantities where exactness is required. However,
the
quantities where exactness is required. However,
arithmetic on
<type>numeric</type>
type is very slow compared to the
<type>numeric</type>
values is very slow compared to the integer
floating-point types described in the next section.
types, or to the
floating-point types described in the next section.
</para>
</para>
<para>
<para>
...
@@ -464,7 +464,8 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.152 2004/12/23 05:37:39 tgl Ex
...
@@ -464,7 +464,8 @@ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.152 2004/12/23 05:37:39 tgl Ex
</para>
</para>
<para>
<para>
Both the precision and the scale of the numeric type can be
Both the maximum precision and the maximum scale of a
<type>numeric</type> column can be
configured. To declare a column of type <type>numeric</type> use
configured. To declare a column of type <type>numeric</type> use
the syntax
the syntax
<programlisting>
<programlisting>
...
@@ -492,10 +493,19 @@ NUMERIC
...
@@ -492,10 +493,19 @@ NUMERIC
</para>
</para>
<para>
<para>
If the precision or scale of a value is greater than the declared
If the scale of a value to be stored is greater than the declared
precision or scale of a column, the system will attempt to round
scale of the column, the system will round the value to the specified
the value. If the value cannot be rounded so as to satisfy the
number of fractional digits. Then, if the number of digits to the
declared limits, an error is raised.
left of the decimal point exceeds the declared precision minus the
declared scale, an error is raised.
</para>
<para>
Numeric values are physically stored without any extra leading or
trailing zeroes. Thus, the declared precision and scale of a column
are maximums, not fixed allocations. (In this sense the <type>numeric</>
type is more akin to <type>varchar(<replaceable>n</>)</type>
than to <type>char(<replaceable>n</>)</type>.)
</para>
</para>
<para>
<para>
...
@@ -1089,13 +1099,18 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1089,13 +1099,18 @@ SELECT b, char_length(b) FROM test2;
<para>
<para>
A binary string is a sequence of octets (or bytes). Binary
A binary string is a sequence of octets (or bytes). Binary
strings are distinguished from character
s
strings by two
strings are distinguished from character strings by two
characteristics: First, binary strings specifically allow storing
characteristics: First, binary strings specifically allow storing
octets of value zero and other <quote>non-printable</quote>
octets of value zero and other <quote>non-printable</quote>
octets (defined as octets outside the range 32 to 126).
octets (usually, octets outside the range 32 to 126).
Character strings disallow zero octets, and also disallow any
other octet values and sequences of octet values that are invalid
according to the database's selected character set encoding.
Second, operations on binary strings process the actual bytes,
Second, operations on binary strings process the actual bytes,
whereas the encoding and processing of character strings depends
whereas the processing of character strings depends on locale settings.
on locale settings.
In short, binary strings are appropriate for storing data that the
programmer thinks of as <quote>raw bytes</>, whereas character
strings are appropriate for storing text.
</para>
</para>
<para>
<para>
...
@@ -1254,7 +1269,7 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1254,7 +1269,7 @@ SELECT b, char_length(b) FROM test2;
<para>
<para>
The <acronym>SQL</acronym> standard defines a different binary
The <acronym>SQL</acronym> standard defines a different binary
string type, called <type>BLOB</type> or <type>BINARY LARGE
string type, called <type>BLOB</type> or <type>BINARY LARGE
OBJECT</type>. The input format is different compared to
OBJECT</type>. The input format is different from
<type>bytea</type>, but the provided functions and operators are
<type>bytea</type>, but the provided functions and operators are
mostly the same.
mostly the same.
</para>
</para>
...
@@ -1295,7 +1310,9 @@ SELECT b, char_length(b) FROM test2;
...
@@ -1295,7 +1310,9 @@ SELECT b, char_length(b) FROM test2;
<para>
<para>
<productname>PostgreSQL</productname> supports the full set of
<productname>PostgreSQL</productname> supports the full set of
<acronym>SQL</acronym> date and time types, shown in <xref
<acronym>SQL</acronym> date and time types, shown in <xref
linkend="datatype-datetime-table">.
linkend="datatype-datetime-table">. The operations available
on these data types are described in
<xref linkend="functions-datetime">.
</para>
</para>
<table id="datatype-datetime-table">
<table id="datatype-datetime-table">
...
@@ -1842,8 +1859,10 @@ January 8 04:05:06 1999 PST
...
@@ -1842,8 +1859,10 @@ January 8 04:05:06 1999 PST
are specially represented inside the system and will be displayed
are specially represented inside the system and will be displayed
the same way; but the others are simply notational shorthands
the same way; but the others are simply notational shorthands
that will be converted to ordinary date/time values when read.
that will be converted to ordinary date/time values when read.
All of these values are treated as normal constants and need to be
(In particular, <literal>now</> and related strings are converted
written in single quotes.
to a specific time value as soon as they are read.)
All of these values need to be written in single quotes when used
as constants in SQL commands.
</para>
</para>
<table id="datatype-datetime-special-table">
<table id="datatype-datetime-special-table">
...
@@ -1908,7 +1927,7 @@ January 8 04:05:06 1999 PST
...
@@ -1908,7 +1927,7 @@ January 8 04:05:06 1999 PST
<literal>CURRENT_DATE</literal>, <literal>CURRENT_TIME</literal>,
<literal>CURRENT_DATE</literal>, <literal>CURRENT_TIME</literal>,
<literal>CURRENT_TIMESTAMP</literal>, <literal>LOCALTIME</literal>,
<literal>CURRENT_TIMESTAMP</literal>, <literal>LOCALTIME</literal>,
<literal>LOCALTIMESTAMP</literal>. The latter four accept an
<literal>LOCALTIMESTAMP</literal>. The latter four accept an
optional precision specification. (See
also
<xref
optional precision specification. (See <xref
linkend="functions-datetime-current">.) Note however that these are
linkend="functions-datetime-current">.) Note however that these are
SQL functions and are <emphasis>not</> recognized as data input strings.
SQL functions and are <emphasis>not</> recognized as data input strings.
</para>
</para>
...
@@ -2265,7 +2284,7 @@ SELECT * FROM test1 WHERE a;
...
@@ -2265,7 +2284,7 @@ SELECT * FROM test1 WHERE a;
not work). This can be accomplished using the
not work). This can be accomplished using the
<literal>CASE</literal> expression: <literal>CASE WHEN
<literal>CASE</literal> expression: <literal>CASE WHEN
<replaceable>boolval</replaceable> THEN 'value if true' ELSE
<replaceable>boolval</replaceable> THEN 'value if true' ELSE
'value if false' END</literal>. See
also
<xref
'value if false' END</literal>. See <xref
linkend="functions-conditional">.
linkend="functions-conditional">.
</para>
</para>
</tip>
</tip>
...
@@ -2454,9 +2473,9 @@ SELECT * FROM test1 WHERE a;
...
@@ -2454,9 +2473,9 @@ SELECT * FROM test1 WHERE a;
<para>
<para>
Paths are represented by lists of connected points. Paths can be
Paths are represented by lists of connected points. Paths can be
<firstterm>open</firstterm>, where
<firstterm>open</firstterm>, where
the first and last points in the list are not connected, or
the first and last points in the list are not con
sidered con
nected, or
<firstterm>closed</firstterm>,
<firstterm>closed</firstterm>,
where the first and last points are connected.
where the first and last points are con
sidered con
nected.
</para>
</para>
<para>
<para>
...
@@ -2558,7 +2577,7 @@ SELECT * FROM test1 WHERE a;
...
@@ -2558,7 +2577,7 @@ SELECT * FROM test1 WHERE a;
is preferable to use these types instead of plain text types to store
is preferable to use these types instead of plain text types to store
network addresses, because
network addresses, because
these types offer input error checking and several specialized
these types offer input error checking and several specialized
operators and functions.
operators and functions
(see <xref linkend="functions-net">)
.
</para>
</para>
<table tocentry="1" id="datatype-net-types-table">
<table tocentry="1" id="datatype-net-types-table">
...
@@ -3006,12 +3025,25 @@ SELECT * FROM test;
...
@@ -3006,12 +3025,25 @@ SELECT * FROM test;
for specialized input and output routines. These routines are able
for specialized input and output routines. These routines are able
to accept and display symbolic names for system objects, rather than
to accept and display symbolic names for system objects, rather than
the raw numeric value that type <type>oid</> would use. The alias
the raw numeric value that type <type>oid</> would use. The alias
types allow simplified lookup of OID values for objects: for example,
types allow simplified lookup of OID values for objects. For example,
one may write <literal>'mytable'::regclass</> to get the OID of table
to examine the <structname>pg_attribute</> rows related to a table
<literal>mytable</>, rather than <literal>SELECT oid FROM pg_class WHERE
<literal>mytable</>, one could write
relname = 'mytable'</>. (In reality, a much more complicated <command>SELECT</> would
<programlisting>
be needed to deal with selecting the right OID when there are multiple
SELECT * FROM pg_attribute WHERE attrelid = 'mytable'::regclass;
tables named <literal>mytable</> in different schemas.)
</programlisting>
rather than
<programlisting>
SELECT * FROM pg_attribute
WHERE attrelid = (SELECT oid FROM pg_class WHERE relname = 'mytable');
</programlisting>
While that doesn't look all that bad by itself, it's still oversimplified.
A far more complicated sub-select would be needed to
select the right OID if there are multiple tables named
<literal>mytable</> in different schemas.
The <type>regclass</> input converter handles the table lookup according
to the schema path setting, and so it does the <quote>right thing</>
automatically. Similarly, casting a table's OID to
<type>regclass</> is handy for symbolic display of a numeric OID.
</para>
</para>
<table id="datatype-oid-table">
<table id="datatype-oid-table">
...
...
doc/src/sgml/func.sgml
View file @
6889537c
<!--
<!--
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.23
2 2004/12/23 23:07:3
8 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.23
3 2005/01/08 05:19:1
8 tgl Exp $
PostgreSQL documentation
PostgreSQL documentation
-->
-->
...
@@ -1227,10 +1227,10 @@ PostgreSQL documentation
...
@@ -1227,10 +1227,10 @@ PostgreSQL documentation
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>
<entry>
Return the given string suitably quoted to be used as an identifier
Return the given string suitably quoted to be used as an identifier
in an <acronym>SQL</acronym> statement string.
in an <acronym>SQL</acronym> statement string.
Quotes are added only if necessary (i.e., if the string contains
Quotes are added only if necessary (i.e., if the string contains
non-identifier characters or would be case-folded).
non-identifier characters or would be case-folded).
Embedded quotes are properly doubled.
Embedded quotes are properly doubled.
</entry>
</entry>
<entry><literal>quote_ident('Foo bar')</literal></entry>
<entry><literal>quote_ident('Foo bar')</literal></entry>
<entry><literal>"Foo bar"</literal></entry>
<entry><literal>"Foo bar"</literal></entry>
...
@@ -1241,8 +1241,8 @@ PostgreSQL documentation
...
@@ -1241,8 +1241,8 @@ PostgreSQL documentation
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>
<entry>
Return the given string suitably quoted to be used as a string literal
Return the given string suitably quoted to be used as a string literal
in an <acronym>SQL</acronym> statement string.
in an <acronym>SQL</acronym> statement string.
Embedded quotes and backslashes are properly doubled.
Embedded quotes and backslashes are properly doubled.
</entry>
</entry>
<entry><literal>quote_literal( 'O\'Reilly')</literal></entry>
<entry><literal>quote_literal( 'O\'Reilly')</literal></entry>
<entry><literal>'O''Reilly'</literal></entry>
<entry><literal>'O''Reilly'</literal></entry>
...
@@ -2302,12 +2302,12 @@ PostgreSQL documentation
...
@@ -2302,12 +2302,12 @@ PostgreSQL documentation
Length of binary string
Length of binary string
<indexterm>
<indexterm>
<primary>binary string</primary>
<primary>binary string</primary>
<secondary>length</secondary>
<secondary>length</secondary>
</indexterm>
</indexterm>
<indexterm>
<indexterm>
<primary>length</primary>
<primary>length</primary>
<secondary sortas="binary string">of a binary string</secondary>
<secondary sortas="binary string">of a binary string</secondary>
<see>binary strings, length</see>
<see>binary strings, length</see>
</indexterm>
</indexterm>
</entry>
</entry>
<entry><literal>length('jo\\000se'::bytea)</literal></entry>
<entry><literal>length('jo\\000se'::bytea)</literal></entry>
...
@@ -3999,61 +3999,61 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -3999,61 +3999,61 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
<tgroup cols="4">
<tgroup cols="4">
<thead>
<thead>
<row>
<row>
<entry>Function</entry>
<entry>Function</entry>
<entry>Return Type</entry>
<entry>Return Type</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry><literal><function>to_char</function>(<type>timestamp</type>, <type>text</type>)</literal></entry>
<entry><literal><function>to_char</function>(<type>timestamp</type>, <type>text</type>)</literal></entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>convert time stamp to string</entry>
<entry>convert time stamp to string</entry>
<entry><literal>to_char(current_timestamp, 'HH12:MI:SS')</literal></entry>
<entry><literal>to_char(current_timestamp, 'HH12:MI:SS')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>to_char</function>(<type>interval</type>, <type>text</type>)</literal></entry>
<entry><literal><function>to_char</function>(<type>interval</type>, <type>text</type>)</literal></entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>convert interval to string</entry>
<entry>convert interval to string</entry>
<entry><literal>to_char(interval '15h 2m 12s', 'HH24:MI:SS')</literal></entry>
<entry><literal>to_char(interval '15h 2m 12s', 'HH24:MI:SS')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>to_char</function>(<type>int</type>, <type>text</type>)</literal></entry>
<entry><literal><function>to_char</function>(<type>int</type>, <type>text</type>)</literal></entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>convert integer to string</entry>
<entry>convert integer to string</entry>
<entry><literal>to_char(125, '999')</literal></entry>
<entry><literal>to_char(125, '999')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>to_char</function>(<type>double precision</type>,
<entry><literal><function>to_char</function>(<type>double precision</type>,
<type>text</type>)</literal></entry>
<type>text</type>)</literal></entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>convert real/double precision to string</entry>
<entry>convert real/double precision to string</entry>
<entry><literal>to_char(125.8::real, '999D9')</literal></entry>
<entry><literal>to_char(125.8::real, '999D9')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>to_char</function>(<type>numeric</type>, <type>text</type>)</literal></entry>
<entry><literal><function>to_char</function>(<type>numeric</type>, <type>text</type>)</literal></entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>convert numeric to string</entry>
<entry>convert numeric to string</entry>
<entry><literal>to_char(-125.8, '999D99S')</literal></entry>
<entry><literal>to_char(-125.8, '999D99S')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>to_date</function>(<type>text</type>, <type>text</type>)</literal></entry>
<entry><literal><function>to_date</function>(<type>text</type>, <type>text</type>)</literal></entry>
<entry><type>date</type></entry>
<entry><type>date</type></entry>
<entry>convert string to date</entry>
<entry>convert string to date</entry>
<entry><literal>to_date('05 Dec 2000', 'DD Mon YYYY')</literal></entry>
<entry><literal>to_date('05 Dec 2000', 'DD Mon YYYY')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>to_timestamp</function>(<type>text</type>, <type>text</type>)</literal></entry>
<entry><literal><function>to_timestamp</function>(<type>text</type>, <type>text</type>)</literal></entry>
<entry><type>timestamp with time zone</type></entry>
<entry><type>timestamp with time zone</type></entry>
<entry>convert string to time stamp</entry>
<entry>convert string to time stamp</entry>
<entry><literal>to_timestamp('05 Dec 2000', 'DD Mon YYYY')</literal></entry>
<entry><literal>to_timestamp('05 Dec 2000', 'DD Mon YYYY')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>to_number</function>(<type>text</type>, <type>text</type>)</literal></entry>
<entry><literal><function>to_number</function>(<type>text</type>, <type>text</type>)</literal></entry>
<entry><type>numeric</type></entry>
<entry><type>numeric</type></entry>
<entry>convert string to numeric</entry>
<entry>convert string to numeric</entry>
<entry><literal>to_number('12,454.8-', '99G999D9S')</literal></entry>
<entry><literal>to_number('12,454.8-', '99G999D9S')</literal></entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -4083,202 +4083,202 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -4083,202 +4083,202 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
<tgroup cols="2">
<tgroup cols="2">
<thead>
<thead>
<row>
<row>
<entry>Pattern</entry>
<entry>Pattern</entry>
<entry>Description</entry>
<entry>Description</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry><literal>HH</literal></entry>
<entry><literal>HH</literal></entry>
<entry>hour of day (01-12)</entry>
<entry>hour of day (01-12)</entry>
</row>
</row>
<row>
<row>
<entry><literal>HH12</literal></entry>
<entry><literal>HH12</literal></entry>
<entry>hour of day (01-12)</entry>
<entry>hour of day (01-12)</entry>
</row>
</row>
<row>
<row>
<entry><literal>HH24</literal></entry>
<entry><literal>HH24</literal></entry>
<entry>hour of day (00-23)</entry>
<entry>hour of day (00-23)</entry>
</row>
</row>
<row>
<row>
<entry><literal>MI</literal></entry>
<entry><literal>MI</literal></entry>
<entry>minute (00-59)</entry>
<entry>minute (00-59)</entry>
</row>
</row>
<row>
<row>
<entry><literal>SS</literal></entry>
<entry><literal>SS</literal></entry>
<entry>second (00-59)</entry>
<entry>second (00-59)</entry>
</row>
</row>
<row>
<row>
<entry><literal>MS</literal></entry>
<entry><literal>MS</literal></entry>
<entry>millisecond (000-999)</entry>
<entry>millisecond (000-999)</entry>
</row>
</row>
<row>
<row>
<entry><literal>US</literal></entry>
<entry><literal>US</literal></entry>
<entry>microsecond (000000-999999)</entry>
<entry>microsecond (000000-999999)</entry>
</row>
</row>
<row>
<row>
<entry><literal>SSSS</literal></entry>
<entry><literal>SSSS</literal></entry>
<entry>seconds past midnight (0-86399)</entry>
<entry>seconds past midnight (0-86399)</entry>
</row>
</row>
<row>
<row>
<entry><literal>AM</literal> or <literal>A.M.</literal> or
<entry><literal>AM</literal> or <literal>A.M.</literal> or
<literal>PM</literal> or <literal>P.M.</literal></entry>
<literal>PM</literal> or <literal>P.M.</literal></entry>
<entry>meridian indicator (uppercase)</entry>
<entry>meridian indicator (uppercase)</entry>
</row>
</row>
<row>
<row>
<entry><literal>am</literal> or <literal>a.m.</literal> or
<entry><literal>am</literal> or <literal>a.m.</literal> or
<literal>pm</literal> or <literal>p.m.</literal></entry>
<literal>pm</literal> or <literal>p.m.</literal></entry>
<entry>meridian indicator (lowercase)</entry>
<entry>meridian indicator (lowercase)</entry>
</row>
</row>
<row>
<row>
<entry><literal>Y,YYY</literal></entry>
<entry><literal>Y,YYY</literal></entry>
<entry>year (4 and more digits) with comma</entry>
<entry>year (4 and more digits) with comma</entry>
</row>
</row>
<row>
<row>
<entry><literal>YYYY</literal></entry>
<entry><literal>YYYY</literal></entry>
<entry>year (4 and more digits)</entry>
<entry>year (4 and more digits)</entry>
</row>
</row>
<row>
<row>
<entry><literal>YYY</literal></entry>
<entry><literal>YYY</literal></entry>
<entry>last 3 digits of year</entry>
<entry>last 3 digits of year</entry>
</row>
</row>
<row>
<row>
<entry><literal>YY</literal></entry>
<entry><literal>YY</literal></entry>
<entry>last 2 digits of year</entry>
<entry>last 2 digits of year</entry>
</row>
</row>
<row>
<row>
<entry><literal>Y</literal></entry>
<entry><literal>Y</literal></entry>
<entry>last digit of year</entry>
<entry>last digit of year</entry>
</row>
</row>
<row>
<row>
<entry><literal>IYYY</literal></entry>
<entry><literal>IYYY</literal></entry>
<entry>ISO year (4 and more digits)</entry>
<entry>ISO year (4 and more digits)</entry>
</row>
</row>
<row>
<row>
<entry><literal>IYY</literal></entry>
<entry><literal>IYY</literal></entry>
<entry>last 3 digits of ISO year</entry>
<entry>last 3 digits of ISO year</entry>
</row>
</row>
<row>
<row>
<entry><literal>IY</literal></entry>
<entry><literal>IY</literal></entry>
<entry>last 2 digits of ISO year</entry>
<entry>last 2 digits of ISO year</entry>
</row>
</row>
<row>
<row>
<entry><literal>I</literal></entry>
<entry><literal>I</literal></entry>
<entry>last digits of ISO year</entry>
<entry>last digits of ISO year</entry>
</row>
</row>
<row>
<row>
<entry><literal>BC</literal> or <literal>B.C.</literal> or
<entry><literal>BC</literal> or <literal>B.C.</literal> or
<literal>AD</literal> or <literal>A.D.</literal></entry>
<literal>AD</literal> or <literal>A.D.</literal></entry>
<entry>era indicator (uppercase)</entry>
<entry>era indicator (uppercase)</entry>
</row>
</row>
<row>
<row>
<entry><literal>bc</literal> or <literal>b.c.</literal> or
<entry><literal>bc</literal> or <literal>b.c.</literal> or
<literal>ad</literal> or <literal>a.d.</literal></entry>
<literal>ad</literal> or <literal>a.d.</literal></entry>
<entry>era indicator (lowercase)</entry>
<entry>era indicator (lowercase)</entry>
</row>
</row>
<row>
<row>
<entry><literal>MONTH</literal></entry>
<entry><literal>MONTH</literal></entry>
<entry>full uppercase month name (blank-padded to 9 chars)</entry>
<entry>full uppercase month name (blank-padded to 9 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>Month</literal></entry>
<entry><literal>Month</literal></entry>
<entry>full mixed-case month name (blank-padded to 9 chars)</entry>
<entry>full mixed-case month name (blank-padded to 9 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>month</literal></entry>
<entry><literal>month</literal></entry>
<entry>full lowercase month name (blank-padded to 9 chars)</entry>
<entry>full lowercase month name (blank-padded to 9 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>MON</literal></entry>
<entry><literal>MON</literal></entry>
<entry>abbreviated uppercase month name (3 chars)</entry>
<entry>abbreviated uppercase month name (3 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>Mon</literal></entry>
<entry><literal>Mon</literal></entry>
<entry>abbreviated mixed-case month name (3 chars)</entry>
<entry>abbreviated mixed-case month name (3 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>mon</literal></entry>
<entry><literal>mon</literal></entry>
<entry>abbreviated lowercase month name (3 chars)</entry>
<entry>abbreviated lowercase month name (3 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>MM</literal></entry>
<entry><literal>MM</literal></entry>
<entry>month number (01-12)</entry>
<entry>month number (01-12)</entry>
</row>
</row>
<row>
<row>
<entry><literal>DAY</literal></entry>
<entry><literal>DAY</literal></entry>
<entry>full uppercase day name (blank-padded to 9 chars)</entry>
<entry>full uppercase day name (blank-padded to 9 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>Day</literal></entry>
<entry><literal>Day</literal></entry>
<entry>full mixed-case day name (blank-padded to 9 chars)</entry>
<entry>full mixed-case day name (blank-padded to 9 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>day</literal></entry>
<entry><literal>day</literal></entry>
<entry>full lowercase day name (blank-padded to 9 chars)</entry>
<entry>full lowercase day name (blank-padded to 9 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>DY</literal></entry>
<entry><literal>DY</literal></entry>
<entry>abbreviated uppercase day name (3 chars)</entry>
<entry>abbreviated uppercase day name (3 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>Dy</literal></entry>
<entry><literal>Dy</literal></entry>
<entry>abbreviated mixed-case day name (3 chars)</entry>
<entry>abbreviated mixed-case day name (3 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>dy</literal></entry>
<entry><literal>dy</literal></entry>
<entry>abbreviated lowercase day name (3 chars)</entry>
<entry>abbreviated lowercase day name (3 chars)</entry>
</row>
</row>
<row>
<row>
<entry><literal>DDD</literal></entry>
<entry><literal>DDD</literal></entry>
<entry>day of year (001-366)</entry>
<entry>day of year (001-366)</entry>
</row>
</row>
<row>
<row>
<entry><literal>DD</literal></entry>
<entry><literal>DD</literal></entry>
<entry>day of month (01-31)</entry>
<entry>day of month (01-31)</entry>
</row>
</row>
<row>
<row>
<entry><literal>D</literal></entry>
<entry><literal>D</literal></entry>
<entry>day of week (1-7; Sunday is 1)</entry>
<entry>day of week (1-7; Sunday is 1)</entry>
</row>
</row>
<row>
<row>
<entry><literal>W</literal></entry>
<entry><literal>W</literal></entry>
<entry>week of month (1-5) (The first week starts on the first day of the month.)</entry>
<entry>week of month (1-5) (The first week starts on the first day of the month.)</entry>
</row>
</row>
<row>
<row>
<entry><literal>WW</literal></entry>
<entry><literal>WW</literal></entry>
<entry>week number of year (1-53) (The first week starts on the first day of the year.)</entry>
<entry>week number of year (1-53) (The first week starts on the first day of the year.)</entry>
</row>
</row>
<row>
<row>
<entry><literal>IW</literal></entry>
<entry><literal>IW</literal></entry>
<entry>ISO week number of year (The first Thursday of the new year is in week 1.)</entry>
<entry>ISO week number of year (The first Thursday of the new year is in week 1.)</entry>
</row>
</row>
<row>
<row>
<entry><literal>CC</literal></entry>
<entry><literal>CC</literal></entry>
<entry>century (2 digits)</entry>
<entry>century (2 digits)</entry>
</row>
</row>
<row>
<row>
<entry><literal>J</literal></entry>
<entry><literal>J</literal></entry>
<entry>Julian Day (days since January 1, 4712 BC)</entry>
<entry>Julian Day (days since January 1, 4712 BC)</entry>
</row>
</row>
<row>
<row>
<entry><literal>Q</literal></entry>
<entry><literal>Q</literal></entry>
<entry>quarter</entry>
<entry>quarter</entry>
</row>
</row>
<row>
<row>
<entry><literal>RM</literal></entry>
<entry><literal>RM</literal></entry>
<entry>month in Roman numerals (I-XII; I=January) (uppercase)</entry>
<entry>month in Roman numerals (I-XII; I=January) (uppercase)</entry>
</row>
</row>
<row>
<row>
<entry><literal>rm</literal></entry>
<entry><literal>rm</literal></entry>
<entry>month in Roman numerals (i-xii; i=January) (lowercase)</entry>
<entry>month in Roman numerals (i-xii; i=January) (lowercase)</entry>
</row>
</row>
<row>
<row>
<entry><literal>TZ</literal></entry>
<entry><literal>TZ</literal></entry>
<entry>time-zone name (uppercase)</entry>
<entry>time-zone name (uppercase)</entry>
</row>
</row>
<row>
<row>
<entry><literal>tz</literal></entry>
<entry><literal>tz</literal></entry>
<entry>time-zone name (lowercase)</entry>
<entry>time-zone name (lowercase)</entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -4298,36 +4298,36 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -4298,36 +4298,36 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
<tgroup cols="3">
<tgroup cols="3">
<thead>
<thead>
<row>
<row>
<entry>Modifier</entry>
<entry>Modifier</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry><literal>FM</literal> prefix</entry>
<entry><literal>FM</literal> prefix</entry>
<entry>fill mode (suppress padding blanks and zeroes)</entry>
<entry>fill mode (suppress padding blanks and zeroes)</entry>
<entry><literal>FMMonth</literal></entry>
<entry><literal>FMMonth</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>TH</literal> suffix</entry>
<entry><literal>TH</literal> suffix</entry>
<entry>uppercase ordinal number suffix</entry>
<entry>uppercase ordinal number suffix</entry>
<entry><literal>DDTH</literal></entry>
<entry><literal>DDTH</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>th</literal> suffix</entry>
<entry><literal>th</literal> suffix</entry>
<entry>lowercase ordinal number suffix</entry>
<entry>lowercase ordinal number suffix</entry>
<entry><literal>DDth</literal></entry>
<entry><literal>DDth</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>FX</literal> prefix</entry>
<entry><literal>FX</literal> prefix</entry>
<entry>fixed format global option (see usage notes)</entry>
<entry>fixed format global option (see usage notes)</entry>
<entry><literal>FX Month DD Day</literal></entry>
<entry><literal>FX Month DD Day</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>SP</literal> suffix</entry>
<entry><literal>SP</literal> suffix</entry>
<entry>spell mode (not yet implemented)</entry>
<entry>spell mode (not yet implemented)</entry>
<entry><literal>DDSP</literal></entry>
<entry><literal>DDSP</literal></entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -4436,74 +4436,74 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -4436,74 +4436,74 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
<tgroup cols="2">
<tgroup cols="2">
<thead>
<thead>
<row>
<row>
<entry>Pattern</entry>
<entry>Pattern</entry>
<entry>Description</entry>
<entry>Description</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry><literal>9</literal></entry>
<entry><literal>9</literal></entry>
<entry>value with the specified number of digits</entry>
<entry>value with the specified number of digits</entry>
</row>
</row>
<row>
<row>
<entry><literal>0</literal></entry>
<entry><literal>0</literal></entry>
<entry>value with leading zeros</entry>
<entry>value with leading zeros</entry>
</row>
</row>
<row>
<row>
<entry><literal>.</literal> (period)</entry>
<entry><literal>.</literal> (period)</entry>
<entry>decimal point</entry>
<entry>decimal point</entry>
</row>
</row>
<row>
<row>
<entry><literal>,</literal> (comma)</entry>
<entry><literal>,</literal> (comma)</entry>
<entry>group (thousand) separator</entry>
<entry>group (thousand) separator</entry>
</row>
</row>
<row>
<row>
<entry><literal>PR</literal></entry>
<entry><literal>PR</literal></entry>
<entry>negative value in angle brackets</entry>
<entry>negative value in angle brackets</entry>
</row>
</row>
<row>
<row>
<entry><literal>S</literal></entry>
<entry><literal>S</literal></entry>
<entry>sign anchored to number (uses locale)</entry>
<entry>sign anchored to number (uses locale)</entry>
</row>
</row>
<row>
<row>
<entry><literal>L</literal></entry>
<entry><literal>L</literal></entry>
<entry>currency symbol (uses locale)</entry>
<entry>currency symbol (uses locale)</entry>
</row>
</row>
<row>
<row>
<entry><literal>D</literal></entry>
<entry><literal>D</literal></entry>
<entry>decimal point (uses locale)</entry>
<entry>decimal point (uses locale)</entry>
</row>
</row>
<row>
<row>
<entry><literal>G</literal></entry>
<entry><literal>G</literal></entry>
<entry>group separator (uses locale)</entry>
<entry>group separator (uses locale)</entry>
</row>
</row>
<row>
<row>
<entry><literal>MI</literal></entry>
<entry><literal>MI</literal></entry>
<entry>minus sign in specified position (if number < 0)</entry>
<entry>minus sign in specified position (if number < 0)</entry>
</row>
</row>
<row>
<row>
<entry><literal>PL</literal></entry>
<entry><literal>PL</literal></entry>
<entry>plus sign in specified position (if number > 0)</entry>
<entry>plus sign in specified position (if number > 0)</entry>
</row>
</row>
<row>
<row>
<entry><literal>SG</literal></entry>
<entry><literal>SG</literal></entry>
<entry>plus/minus sign in specified position</entry>
<entry>plus/minus sign in specified position</entry>
</row>
</row>
<row>
<row>
<entry><literal>RN</literal></entry>
<entry><literal>RN</literal></entry>
<entry>roman numeral (input between 1 and 3999)</entry>
<entry>roman numeral (input between 1 and 3999)</entry>
</row>
</row>
<row>
<row>
<entry><literal>TH</literal> or <literal>th</literal></entry>
<entry><literal>TH</literal> or <literal>th</literal></entry>
<entry>ordinal number suffix</entry>
<entry>ordinal number suffix</entry>
</row>
</row>
<row>
<row>
<entry><literal>V</literal></entry>
<entry><literal>V</literal></entry>
<entry>shift specified number of digits (see notes)</entry>
<entry>shift specified number of digits (see notes)</entry>
</row>
</row>
<row>
<row>
<entry><literal>EEEE</literal></entry>
<entry><literal>EEEE</literal></entry>
<entry>scientific notation (not implemented yet)</entry>
<entry>scientific notation (not implemented yet)</entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -4575,8 +4575,8 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -4575,8 +4575,8 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
<tgroup cols="2">
<tgroup cols="2">
<thead>
<thead>
<row>
<row>
<entry>Expression</entry>
<entry>Expression</entry>
<entry>Result</entry>
<entry>Result</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
...
@@ -4642,7 +4642,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -4642,7 +4642,7 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
</row>
<row>
<row>
<entry><literal>to_char(148.5, '999D999')</literal></entry>
<entry><literal>to_char(148.5, '999D999')</literal></entry>
<entry><literal>' 148,500'</literal></entry>
<entry><literal>' 148,500'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(3148.5, '9G999D999')</literal></entry>
<entry><literal>to_char(3148.5, '9G999D999')</literal></entry>
...
@@ -4652,57 +4652,57 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -4652,57 +4652,57 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
<entry><literal>to_char(-485, '999S')</literal></entry>
<entry><literal>to_char(-485, '999S')</literal></entry>
<entry><literal>'485-'</literal></entry>
<entry><literal>'485-'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(-485, '999MI')</literal></entry>
<entry><literal>to_char(-485, '999MI')</literal></entry>
<entry><literal>'485-'</literal></entry>
<entry><literal>'485-'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(485, '999MI')</literal></entry>
<entry><literal>to_char(485, '999MI')</literal></entry>
<entry><literal>'485 '</literal></entry>
<entry><literal>'485 '</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(485, 'FM999MI')</literal></entry>
<entry><literal>to_char(485, 'FM999MI')</literal></entry>
<entry><literal>'485'</literal></entry>
<entry><literal>'485'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(485, 'PL999')</literal></entry>
<entry><literal>to_char(485, 'PL999')</literal></entry>
<entry><literal>'+485'</literal></entry>
<entry><literal>'+485'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(485, 'SG999')</literal></entry>
<entry><literal>to_char(485, 'SG999')</literal></entry>
<entry><literal>'+485'</literal></entry>
<entry><literal>'+485'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(-485, 'SG999')</literal></entry>
<entry><literal>to_char(-485, 'SG999')</literal></entry>
<entry><literal>'-485'</literal></entry>
<entry><literal>'-485'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(-485, '9SG99')</literal></entry>
<entry><literal>to_char(-485, '9SG99')</literal></entry>
<entry><literal>'4-85'</literal></entry>
<entry><literal>'4-85'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(-485, '999PR')</literal></entry>
<entry><literal>to_char(-485, '999PR')</literal></entry>
<entry><literal>'<485>'</literal></entry>
<entry><literal>'<485>'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(485, 'L999')</literal></entry>
<entry><literal>to_char(485, 'L999')</literal></entry>
<entry><literal>'DM 485</literal></entry>
<entry><literal>'DM 485</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(485, 'RN')</literal></entry>
<entry><literal>to_char(485, 'RN')</literal></entry>
<entry><literal>' CDLXXXV'</literal></entry>
<entry><literal>' CDLXXXV'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(485, 'FMRN')</literal></entry>
<entry><literal>to_char(485, 'FMRN')</literal></entry>
<entry><literal>'CDLXXXV'</literal></entry>
<entry><literal>'CDLXXXV'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(5.2, 'FMRN')</literal></entry>
<entry><literal>to_char(5.2, 'FMRN')</literal></entry>
<entry><literal>'V'</literal></entry>
<entry><literal>'V'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(482, '999th')</literal></entry>
<entry><literal>to_char(482, '999th')</literal></entry>
<entry><literal>' 482nd'</literal></entry>
<entry><literal>' 482nd'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(485, '"Good number:"999')</literal></entry>
<entry><literal>to_char(485, '"Good number:"999')</literal></entry>
...
@@ -4713,14 +4713,14 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -4713,14 +4713,14 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
<entry><literal>'Pre: 485 Post: .800'</literal></entry>
<entry><literal>'Pre: 485 Post: .800'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(12, '99V999')</literal></entry>
<entry><literal>to_char(12, '99V999')</literal></entry>
<entry><literal>' 12000'</literal></entry>
<entry><literal>' 12000'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(12.4, '99V999')</literal></entry>
<entry><literal>to_char(12.4, '99V999')</literal></entry>
<entry><literal>' 12400'</literal></entry>
<entry><literal>' 12400'</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal>to_char(12.45, '99V9')</literal></entry>
<entry><literal>to_char(12.45, '99V9')</literal></entry>
<entry><literal>' 125'</literal></entry>
<entry><literal>' 125'</literal></entry>
</row>
</row>
...
@@ -4879,39 +4879,39 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -4879,39 +4879,39 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
<tgroup cols="5">
<tgroup cols="5">
<thead>
<thead>
<row>
<row>
<entry>Function</entry>
<entry>Function</entry>
<entry>Return Type</entry>
<entry>Return Type</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
<entry>Result</entry>
<entry>Result</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry><literal><function>age</function>(<type>timestamp</type>, <type>timestamp</type>)</literal></entry>
<entry><literal><function>age</function>(<type>timestamp</type>, <type>timestamp</type>)</literal></entry>
<entry><type>interval</type></entry>
<entry><type>interval</type></entry>
<entry>Subtract arguments, producing a <quote>symbolic</> result that
<entry>Subtract arguments, producing a <quote>symbolic</> result that
uses years and months</entry>
uses years and months</entry>
<entry><literal>age(timestamp '2001-04-10', timestamp '1957-06-13')</literal></entry>
<entry><literal>age(timestamp '2001-04-10', timestamp '1957-06-13')</literal></entry>
<entry><literal>43 years 9 mons 27 days</literal></entry>
<entry><literal>43 years 9 mons 27 days</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>age</function>(<type>timestamp</type>)</literal></entry>
<entry><literal><function>age</function>(<type>timestamp</type>)</literal></entry>
<entry><type>interval</type></entry>
<entry><type>interval</type></entry>
<entry>Subtract from <function>current_date</function></entry>
<entry>Subtract from <function>current_date</function></entry>
<entry><literal>age(timestamp '1957-06-13')</literal></entry>
<entry><literal>age(timestamp '1957-06-13')</literal></entry>
<entry><literal>43 years 8 mons 3 days</literal></entry>
<entry><literal>43 years 8 mons 3 days</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>current_date</function></literal></entry>
<entry><literal><function>current_date</function></literal></entry>
<entry><type>date</type></entry>
<entry><type>date</type></entry>
<entry>Today's date; see <xref linkend="functions-datetime-current">
<entry>Today's date; see <xref linkend="functions-datetime-current">
</entry>
</entry>
<entry></entry>
<entry></entry>
<entry></entry>
<entry></entry>
</row>
</row>
<row>
<row>
...
@@ -4924,78 +4924,78 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -4924,78 +4924,78 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
</row>
<row>
<row>
<entry><literal><function>current_timestamp</function></literal></entry>
<entry><literal><function>current_timestamp</function></literal></entry>
<entry><type>timestamp with time zone</type></entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Date and time; see <xref linkend="functions-datetime-current">
<entry>Date and time; see <xref linkend="functions-datetime-current">
</entry>
</entry>
<entry></entry>
<entry></entry>
<entry></entry>
<entry></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>date_part</function>(<type>text</type>, <type>timestamp</type>)</literal></entry>
<entry><literal><function>date_part</function>(<type>text</type>, <type>timestamp</type>)</literal></entry>
<entry><type>double precision</type></entry>
<entry><type>double precision</type></entry>
<entry>Get subfield (equivalent to
<entry>Get subfield (equivalent to
<function>extract</function>); see <xref linkend="functions-datetime-extract">
<function>extract</function>); see <xref linkend="functions-datetime-extract">
</entry>
</entry>
<entry><literal>date_part('hour', timestamp '2001-02-16 20:38:40')</literal></entry>
<entry><literal>date_part('hour', timestamp '2001-02-16 20:38:40')</literal></entry>
<entry><literal>20</literal></entry>
<entry><literal>20</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>date_part</function>(<type>text</type>, <type>interval</type>)</literal></entry>
<entry><literal><function>date_part</function>(<type>text</type>, <type>interval</type>)</literal></entry>
<entry><type>double precision</type></entry>
<entry><type>double precision</type></entry>
<entry>Get subfield (equivalent to
<entry>Get subfield (equivalent to
<function>extract</function>); see <xref linkend="functions-datetime-extract">
<function>extract</function>); see <xref linkend="functions-datetime-extract">
</entry>
</entry>
<entry><literal>date_part('month', interval '2 years 3 months')</literal></entry>
<entry><literal>date_part('month', interval '2 years 3 months')</literal></entry>
<entry><literal>3</literal></entry>
<entry><literal>3</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>date_trunc</function>(<type>text</type>, <type>timestamp</type>)</literal></entry>
<entry><literal><function>date_trunc</function>(<type>text</type>, <type>timestamp</type>)</literal></entry>
<entry><type>timestamp</type></entry>
<entry><type>timestamp</type></entry>
<entry>Truncate to specified precision; see also <xref
<entry>Truncate to specified precision; see also <xref
linkend="functions-datetime-trunc">
linkend="functions-datetime-trunc">
</entry>
</entry>
<entry><literal>date_trunc('hour', timestamp '2001-02-16 20:38:40')</literal></entry>
<entry><literal>date_trunc('hour', timestamp '2001-02-16 20:38:40')</literal></entry>
<entry><literal>2001-02-16 20:00:00</literal></entry>
<entry><literal>2001-02-16 20:00:00</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>extract</function>(<parameter>field</parameter> from
<entry><literal><function>extract</function>(<parameter>field</parameter> from
<type>timestamp</type>)</literal></entry>
<type>timestamp</type>)</literal></entry>
<entry><type>double precision</type></entry>
<entry><type>double precision</type></entry>
<entry>Get subfield; see <xref linkend="functions-datetime-extract">
<entry>Get subfield; see <xref linkend="functions-datetime-extract">
</entry>
</entry>
<entry><literal>extract(hour from timestamp '2001-02-16 20:38:40')</literal></entry>
<entry><literal>extract(hour from timestamp '2001-02-16 20:38:40')</literal></entry>
<entry><literal>20</literal></entry>
<entry><literal>20</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>extract</function>(<parameter>field</parameter> from
<entry><literal><function>extract</function>(<parameter>field</parameter> from
<type>interval</type>)</literal></entry>
<type>interval</type>)</literal></entry>
<entry><type>double precision</type></entry>
<entry><type>double precision</type></entry>
<entry>Get subfield; see <xref linkend="functions-datetime-extract">
<entry>Get subfield; see <xref linkend="functions-datetime-extract">
</entry>
</entry>
<entry><literal>extract(month from interval '2 years 3 months')</literal></entry>
<entry><literal>extract(month from interval '2 years 3 months')</literal></entry>
<entry><literal>3</literal></entry>
<entry><literal>3</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>isfinite</function>(<type>timestamp</type>)</literal></entry>
<entry><literal><function>isfinite</function>(<type>timestamp</type>)</literal></entry>
<entry><type>boolean</type></entry>
<entry><type>boolean</type></entry>
<entry>Test for finite time stamp (not equal to infinity)</entry>
<entry>Test for finite time stamp (not equal to infinity)</entry>
<entry><literal>isfinite(timestamp '2001-02-16 21:28:30')</literal></entry>
<entry><literal>isfinite(timestamp '2001-02-16 21:28:30')</literal></entry>
<entry><literal>true</literal></entry>
<entry><literal>true</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>isfinite</function>(<type>interval</type>)</literal></entry>
<entry><literal><function>isfinite</function>(<type>interval</type>)</literal></entry>
<entry><type>boolean</type></entry>
<entry><type>boolean</type></entry>
<entry>Test for finite interval</entry>
<entry>Test for finite interval</entry>
<entry><literal>isfinite(interval '4 hours')</literal></entry>
<entry><literal>isfinite(interval '4 hours')</literal></entry>
<entry><literal>true</literal></entry>
<entry><literal>true</literal></entry>
</row>
</row>
<row>
<row>
...
@@ -5017,24 +5017,24 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
...
@@ -5017,24 +5017,24 @@ substring('foobar' from 'o(.)b') <lineannotation>o</lineannotation>
</row>
</row>
<row>
<row>
<entry><literal><function>now</function>()</literal></entry>
<entry><literal><function>now</function>()</literal></entry>
<entry><type>timestamp with time zone</type></entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Current date and time (equivalent to
<entry>Current date and time (equivalent to
<function>current_timestamp</function>); see <xref
<function>current_timestamp</function>); see <xref
linkend="functions-datetime-current">
linkend="functions-datetime-current">
</entry>
</entry>
<entry></entry>
<entry></entry>
<entry></entry>
<entry></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>timeofday()</function></literal></entry>
<entry><literal><function>timeofday()</function></literal></entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>Current date and time; see <xref
<entry>Current date and time; see <xref
linkend="functions-datetime-current">
linkend="functions-datetime-current">
</entry>
</entry>
<entry></entry>
<entry></entry>
<entry></entry>
<entry></entry>
</row>
</row>
</tbody>
</tbody>
...
@@ -5185,7 +5185,7 @@ SELECT EXTRACT(DOY FROM TIMESTAMP '2001-02-16 20:38:40');
...
@@ -5185,7 +5185,7 @@ SELECT EXTRACT(DOY FROM TIMESTAMP '2001-02-16 20:38:40');
<para>
<para>
For <type>date</type> and <type>timestamp</type> values, the
For <type>date</type> and <type>timestamp</type> values, the
number of seconds since 1970-01-01 00:00:00-00 (can be negative);
number of seconds since 1970-01-01 00:00:00-00 (can be negative);
for <type>interval</type> values, the total number
for <type>interval</type> values, the total number
of seconds in the interval
of seconds in the interval
</para>
</para>
...
@@ -5203,7 +5203,7 @@ SELECT EXTRACT(EPOCH FROM INTERVAL '5 days 3 hours');
...
@@ -5203,7 +5203,7 @@ SELECT EXTRACT(EPOCH FROM INTERVAL '5 days 3 hours');
</para>
</para>
<screen>
<screen>
SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 982384720 *
interval
'1 second';
SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 982384720 *
INTERVAL
'1 second';
</screen>
</screen>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -5351,8 +5351,8 @@ SELECT EXTRACT(SECOND FROM TIME '17:12:28.5');
...
@@ -5351,8 +5351,8 @@ SELECT EXTRACT(SECOND FROM TIME '17:12:28.5');
<listitem>
<listitem>
<para>
<para>
The time zone offset from UTC, measured in seconds. Positive values
The time zone offset from UTC, measured in seconds. Positive values
correspond to time zones east of UTC, negative values to
correspond to time zones east of UTC, negative values to
zones west of UTC.
zones west of UTC.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -5515,35 +5515,35 @@ SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40');
...
@@ -5515,35 +5515,35 @@ SELECT date_trunc('year', TIMESTAMP '2001-02-16 20:38:40');
<tgroup cols="3">
<tgroup cols="3">
<thead>
<thead>
<row>
<row>
<entry>Expression</entry>
<entry>Expression</entry>
<entry>Return Type</entry>
<entry>Return Type</entry>
<entry>Description</entry>
<entry>Description</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry>
<entry>
<literal><type>timestamp without time zone</type> AT TIME ZONE <replaceable>zone</></literal>
<literal><type>timestamp without time zone</type> AT TIME ZONE <replaceable>zone</></literal>
</entry>
</entry>
<entry><type>timestamp with time zone</type></entry>
<entry><type>timestamp with time zone</type></entry>
<entry>Convert local time in given time zone to UTC</entry>
<entry>Convert local time in given time zone to UTC</entry>
</row>
</row>
<row>
<row>
<entry>
<entry>
<literal><type>timestamp with time zone</type> AT TIME ZONE <replaceable>zone</></literal>
<literal><type>timestamp with time zone</type> AT TIME ZONE <replaceable>zone</></literal>
</entry>
</entry>
<entry><type>timestamp without time zone</type></entry>
<entry><type>timestamp without time zone</type></entry>
<entry>Convert UTC to local time in given time zone</entry>
<entry>Convert UTC to local time in given time zone</entry>
</row>
</row>
<row>
<row>
<entry>
<entry>
<literal><type>time with time zone</type> AT TIME ZONE <replaceable>zone</></literal>
<literal><type>time with time zone</type> AT TIME ZONE <replaceable>zone</></literal>
</entry>
</entry>
<entry><type>time with time zone</type></entry>
<entry><type>time with time zone</type></entry>
<entry>Convert local time across time zones</entry>
<entry>Convert local time across time zones</entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -5737,146 +5737,146 @@ SELECT TIMESTAMP 'now';
...
@@ -5737,146 +5737,146 @@ SELECT TIMESTAMP 'now';
<tgroup cols="3">
<tgroup cols="3">
<thead>
<thead>
<row>
<row>
<entry>Operator</entry>
<entry>Operator</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry> <literal>+</literal> </entry>
<entry> <literal>+</literal> </entry>
<entry>Translation</entry>
<entry>Translation</entry>
<entry><literal>box '((0,0),(1,1))' + point '(2.0,0)'</literal></entry>
<entry><literal>box '((0,0),(1,1))' + point '(2.0,0)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>-</literal> </entry>
<entry> <literal>-</literal> </entry>
<entry>Translation</entry>
<entry>Translation</entry>
<entry><literal>box '((0,0),(1,1))' - point '(2.0,0)'</literal></entry>
<entry><literal>box '((0,0),(1,1))' - point '(2.0,0)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>*</literal> </entry>
<entry> <literal>*</literal> </entry>
<entry>Scaling/rotation</entry>
<entry>Scaling/rotation</entry>
<entry><literal>box '((0,0),(1,1))' * point '(2.0,0)'</literal></entry>
<entry><literal>box '((0,0),(1,1))' * point '(2.0,0)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>/</literal> </entry>
<entry> <literal>/</literal> </entry>
<entry>Scaling/rotation</entry>
<entry>Scaling/rotation</entry>
<entry><literal>box '((0,0),(2,2))' / point '(2.0,0)'</literal></entry>
<entry><literal>box '((0,0),(2,2))' / point '(2.0,0)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>#</literal> </entry>
<entry> <literal>#</literal> </entry>
<entry>Point or box of intersection</entry>
<entry>Point or box of intersection</entry>
<entry><literal>'((1,-1),(-1,1))' # '((1,1),(-1,-1))'</literal></entry>
<entry><literal>'((1,-1),(-1,1))' # '((1,1),(-1,-1))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>#</literal> </entry>
<entry> <literal>#</literal> </entry>
<entry>Number of points in path or polygon</entry>
<entry>Number of points in path or polygon</entry>
<entry><literal># '((1,0),(0,1),(-1,0))'</literal></entry>
<entry><literal># '((1,0),(0,1),(-1,0))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>@-@</literal> </entry>
<entry> <literal>@-@</literal> </entry>
<entry>Length or circumference</entry>
<entry>Length or circumference</entry>
<entry><literal>@-@ path '((0,0),(1,0))'</literal></entry>
<entry><literal>@-@ path '((0,0),(1,0))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>@@</literal> </entry>
<entry> <literal>@@</literal> </entry>
<entry>Center</entry>
<entry>Center</entry>
<entry><literal>@@ circle '((0,0),10)'</literal></entry>
<entry><literal>@@ circle '((0,0),10)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>##</literal> </entry>
<entry> <literal>##</literal> </entry>
<entry>Closest point to first operand on second operand</entry>
<entry>Closest point to first operand on second operand</entry>
<entry><literal>point '(0,0)' ## lseg '((2,0),(0,2))'</literal></entry>
<entry><literal>point '(0,0)' ## lseg '((2,0),(0,2))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal><-></literal> </entry>
<entry> <literal><-></literal> </entry>
<entry>Distance between</entry>
<entry>Distance between</entry>
<entry><literal>circle '((0,0),1)' <-> circle '((5,0),1)'</literal></entry>
<entry><literal>circle '((0,0),1)' <-> circle '((5,0),1)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>&&</literal> </entry>
<entry> <literal>&&</literal> </entry>
<entry>Overlaps?</entry>
<entry>Overlaps?</entry>
<entry><literal>box '((0,0),(1,1))' && box '((0,0),(2,2))'</literal></entry>
<entry><literal>box '((0,0),(1,1))' && box '((0,0),(2,2))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>&<</literal> </entry>
<entry> <literal>&<</literal> </entry>
<entry>Does not extend to the right of?</entry>
<entry>Does not extend to the right of?</entry>
<entry><literal>box '((0,0),(1,1))' &< box '((0,0),(2,2))'</literal></entry>
<entry><literal>box '((0,0),(1,1))' &< box '((0,0),(2,2))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>&></literal> </entry>
<entry> <literal>&></literal> </entry>
<entry>Does not extend to the left of?</entry>
<entry>Does not extend to the left of?</entry>
<entry><literal>box '((0,0),(3,3))' &> box '((0,0),(2,2))'</literal></entry>
<entry><literal>box '((0,0),(3,3))' &> box '((0,0),(2,2))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal><<</literal> </entry>
<entry> <literal><<</literal> </entry>
<entry>Is left of?</entry>
<entry>Is left of?</entry>
<entry><literal>circle '((0,0),1)' << circle '((5,0),1)'</literal></entry>
<entry><literal>circle '((0,0),1)' << circle '((5,0),1)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>>></literal> </entry>
<entry> <literal>>></literal> </entry>
<entry>Is right of?</entry>
<entry>Is right of?</entry>
<entry><literal>circle '((5,0),1)' >> circle '((0,0),1)'</literal></entry>
<entry><literal>circle '((5,0),1)' >> circle '((0,0),1)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal><^</literal> </entry>
<entry> <literal><^</literal> </entry>
<entry>Is below?</entry>
<entry>Is below?</entry>
<entry><literal>circle '((0,0),1)' <^ circle '((0,5),1)'</literal></entry>
<entry><literal>circle '((0,0),1)' <^ circle '((0,5),1)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>>^</literal> </entry>
<entry> <literal>>^</literal> </entry>
<entry>Is above?</entry>
<entry>Is above?</entry>
<entry><literal>circle '((0,5),1)' >^ circle '((0,0),1)'</literal></entry>
<entry><literal>circle '((0,5),1)' >^ circle '((0,0),1)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>?#</literal> </entry>
<entry> <literal>?#</literal> </entry>
<entry>Intersects?</entry>
<entry>Intersects?</entry>
<entry><literal>lseg '((-1,0),(1,0))' ?# box '((-2,-2),(2,2))'</literal></entry>
<entry><literal>lseg '((-1,0),(1,0))' ?# box '((-2,-2),(2,2))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>?-</literal> </entry>
<entry> <literal>?-</literal> </entry>
<entry>Is horizontal?</entry>
<entry>Is horizontal?</entry>
<entry><literal>?- lseg '((-1,0),(1,0))'</literal></entry>
<entry><literal>?- lseg '((-1,0),(1,0))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>?-</literal> </entry>
<entry> <literal>?-</literal> </entry>
<entry>Are horizontally aligned?</entry>
<entry>Are horizontally aligned?</entry>
<entry><literal>point '(1,0)' ?- point '(0,0)'</literal></entry>
<entry><literal>point '(1,0)' ?- point '(0,0)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>?|</literal> </entry>
<entry> <literal>?|</literal> </entry>
<entry>Is vertical?</entry>
<entry>Is vertical?</entry>
<entry><literal>?| lseg '((-1,0),(1,0))'</literal></entry>
<entry><literal>?| lseg '((-1,0),(1,0))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>?|</literal> </entry>
<entry> <literal>?|</literal> </entry>
<entry>Are vertically aligned?</entry>
<entry>Are vertically aligned?</entry>
<entry><literal>point '(0,1)' ?| point '(0,0)'</literal></entry>
<entry><literal>point '(0,1)' ?| point '(0,0)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>?-|</literal> </entry>
<entry> <literal>?-|</literal> </entry>
<entry>Is perpendicular?</entry>
<entry>Is perpendicular?</entry>
<entry><literal>lseg '((0,0),(0,1))' ?-| lseg '((0,0),(1,0))'</literal></entry>
<entry><literal>lseg '((0,0),(0,1))' ?-| lseg '((0,0),(1,0))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>?||</literal> </entry>
<entry> <literal>?||</literal> </entry>
<entry>Are parallel?</entry>
<entry>Are parallel?</entry>
<entry><literal>lseg '((-1,0),(1,0))' ?|| lseg '((-1,2),(1,2))'</literal></entry>
<entry><literal>lseg '((-1,0),(1,0))' ?|| lseg '((-1,2),(1,2))'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>~</literal> </entry>
<entry> <literal>~</literal> </entry>
<entry>Contains?</entry>
<entry>Contains?</entry>
<entry><literal>circle '((0,0),2)' ~ point '(1,1)'</literal></entry>
<entry><literal>circle '((0,0),2)' ~ point '(1,1)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>@</literal> </entry>
<entry> <literal>@</literal> </entry>
<entry>Contained in or on?</entry>
<entry>Contained in or on?</entry>
<entry><literal>point '(1,1)' @ circle '((0,0),2)'</literal></entry>
<entry><literal>point '(1,1)' @ circle '((0,0),2)'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>~=</literal> </entry>
<entry> <literal>~=</literal> </entry>
<entry>Same as?</entry>
<entry>Same as?</entry>
<entry><literal>polygon '((0,0),(1,1))' ~= polygon '((1,1),(0,0))'</literal></entry>
<entry><literal>polygon '((0,0),(1,1))' ~= polygon '((1,1),(0,0))'</literal></entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -5888,105 +5888,105 @@ SELECT TIMESTAMP 'now';
...
@@ -5888,105 +5888,105 @@ SELECT TIMESTAMP 'now';
<tgroup cols="4">
<tgroup cols="4">
<thead>
<thead>
<row>
<row>
<entry>Function</entry>
<entry>Function</entry>
<entry>Return Type</entry>
<entry>Return Type</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry><literal><function>area</function>(<replaceable>object</>)</literal></entry>
<entry><literal><function>area</function>(<replaceable>object</>)</literal></entry>
<entry><type>double precision</type></entry>
<entry><type>double precision</type></entry>
<entry>area</entry>
<entry>area</entry>
<entry><literal>area(box '((0,0),(1,1))')</literal></entry>
<entry><literal>area(box '((0,0),(1,1))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>box_intersect</function>(<type>box</>, <type>box</>)</literal></entry>
<entry><literal><function>box_intersect</function>(<type>box</>, <type>box</>)</literal></entry>
<entry><type>box</type></entry>
<entry><type>box</type></entry>
<entry>intersection box</entry>
<entry>intersection box</entry>
<entry><literal>box_intersect(box '((0,0),(1,1))',box '((0.5,0.5),(2,2))')</literal></entry>
<entry><literal>box_intersect(box '((0,0),(1,1))',box '((0.5,0.5),(2,2))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>center</function>(<replaceable>object</>)</literal></entry>
<entry><literal><function>center</function>(<replaceable>object</>)</literal></entry>
<entry><type>point</type></entry>
<entry><type>point</type></entry>
<entry>center</entry>
<entry>center</entry>
<entry><literal>center(box '((0,0),(1,2))')</literal></entry>
<entry><literal>center(box '((0,0),(1,2))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>diameter</function>(<type>circle</>)</literal></entry>
<entry><literal><function>diameter</function>(<type>circle</>)</literal></entry>
<entry><type>double precision</type></entry>
<entry><type>double precision</type></entry>
<entry>diameter of circle</entry>
<entry>diameter of circle</entry>
<entry><literal>diameter(circle '((0,0),2.0)')</literal></entry>
<entry><literal>diameter(circle '((0,0),2.0)')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>height</function>(<type>box</>)</literal></entry>
<entry><literal><function>height</function>(<type>box</>)</literal></entry>
<entry><type>double precision</type></entry>
<entry><type>double precision</type></entry>
<entry>vertical size of box</entry>
<entry>vertical size of box</entry>
<entry><literal>height(box '((0,0),(1,1))')</literal></entry>
<entry><literal>height(box '((0,0),(1,1))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>isclosed</function>(<type>path</>)</literal></entry>
<entry><literal><function>isclosed</function>(<type>path</>)</literal></entry>
<entry><type>boolean</type></entry>
<entry><type>boolean</type></entry>
<entry>a closed path?</entry>
<entry>a closed path?</entry>
<entry><literal>isclosed(path '((0,0),(1,1),(2,0))')</literal></entry>
<entry><literal>isclosed(path '((0,0),(1,1),(2,0))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>isopen</function>(<type>path</>)</literal></entry>
<entry><literal><function>isopen</function>(<type>path</>)</literal></entry>
<entry><type>boolean</type></entry>
<entry><type>boolean</type></entry>
<entry>an open path?</entry>
<entry>an open path?</entry>
<entry><literal>isopen(path '[(0,0),(1,1),(2,0)]')</literal></entry>
<entry><literal>isopen(path '[(0,0),(1,1),(2,0)]')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>length</function>(<replaceable>object</>)</literal></entry>
<entry><literal><function>length</function>(<replaceable>object</>)</literal></entry>
<entry><type>double precision</type></entry>
<entry><type>double precision</type></entry>
<entry>length</entry>
<entry>length</entry>
<entry><literal>length(path '((-1,0),(1,0))')</literal></entry>
<entry><literal>length(path '((-1,0),(1,0))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>npoints</function>(<type>path</>)</literal></entry>
<entry><literal><function>npoints</function>(<type>path</>)</literal></entry>
<entry><type>integer</type></entry>
<entry><type>integer</type></entry>
<entry>number of points</entry>
<entry>number of points</entry>
<entry><literal>npoints(path '[(0,0),(1,1),(2,0)]')</literal></entry>
<entry><literal>npoints(path '[(0,0),(1,1),(2,0)]')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>npoints</function>(<type>polygon</>)</literal></entry>
<entry><literal><function>npoints</function>(<type>polygon</>)</literal></entry>
<entry><type>integer</type></entry>
<entry><type>integer</type></entry>
<entry>number of points</entry>
<entry>number of points</entry>
<entry><literal>npoints(polygon '((1,1),(0,0))')</literal></entry>
<entry><literal>npoints(polygon '((1,1),(0,0))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>pclose</function>(<type>path</>)</literal></entry>
<entry><literal><function>pclose</function>(<type>path</>)</literal></entry>
<entry><type>path</type></entry>
<entry><type>path</type></entry>
<entry>convert path to closed</entry>
<entry>convert path to closed</entry>
<entry><literal>pclose(path '[(0,0),(1,1),(2,0)]')</literal></entry>
<entry><literal>pclose(path '[(0,0),(1,1),(2,0)]')</literal></entry>
</row>
</row>
<![IGNORE[
<![IGNORE[
<!-- Not defined by this name. Implements the intersection operator '#' -->
<!-- Not defined by this name. Implements the intersection operator '#' -->
<row>
<row>
<entry><literal><function>point</function>(<type>lseg</>, <type>lseg</>)</literal></entry>
<entry><literal><function>point</function>(<type>lseg</>, <type>lseg</>)</literal></entry>
<entry><type>point</type></entry>
<entry><type>point</type></entry>
<entry>intersection</entry>
<entry>intersection</entry>
<entry><literal>point(lseg '((-1,0),(1,0))',lseg '((-2,-2),(2,2))')</literal></entry>
<entry><literal>point(lseg '((-1,0),(1,0))',lseg '((-2,-2),(2,2))')</literal></entry>
</row>
</row>
]]>
]]>
<row>
<row>
<entry><literal><function>popen</function>(<type>path</>)</literal></entry>
<entry><literal><function>popen</function>(<type>path</>)</literal></entry>
<entry><type>path</type></entry>
<entry><type>path</type></entry>
<entry>convert path to open</entry>
<entry>convert path to open</entry>
<entry><literal>popen(path '((0,0),(1,1),(2,0))')</literal></entry>
<entry><literal>popen(path '((0,0),(1,1),(2,0))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>radius</function>(<type>circle</type>)</literal></entry>
<entry><literal><function>radius</function>(<type>circle</type>)</literal></entry>
<entry><type>double precision</type></entry>
<entry><type>double precision</type></entry>
<entry>radius of circle</entry>
<entry>radius of circle</entry>
<entry><literal>radius(circle '((0,0),2.0)')</literal></entry>
<entry><literal>radius(circle '((0,0),2.0)')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>width</function>(<type>box</>)</literal></entry>
<entry><literal><function>width</function>(<type>box</>)</literal></entry>
<entry><type>double precision</type></entry>
<entry><type>double precision</type></entry>
<entry>horizontal size of box</entry>
<entry>horizontal size of box</entry>
<entry><literal>width(box '((0,0),(1,1))')</literal></entry>
<entry><literal>width(box '((0,0),(1,1))')</literal></entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -5998,102 +5998,102 @@ SELECT TIMESTAMP 'now';
...
@@ -5998,102 +5998,102 @@ SELECT TIMESTAMP 'now';
<tgroup cols="4">
<tgroup cols="4">
<thead>
<thead>
<row>
<row>
<entry>Function</entry>
<entry>Function</entry>
<entry>Return Type</entry>
<entry>Return Type</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry><literal><function>box</function>(<type>circle</type>)</literal></entry>
<entry><literal><function>box</function>(<type>circle</type>)</literal></entry>
<entry><type>box</type></entry>
<entry><type>box</type></entry>
<entry>circle to box</entry>
<entry>circle to box</entry>
<entry><literal>box(circle '((0,0),2.0)')</literal></entry>
<entry><literal>box(circle '((0,0),2.0)')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>box</function>(<type>point</type>, <type>point</type>)</literal></entry>
<entry><literal><function>box</function>(<type>point</type>, <type>point</type>)</literal></entry>
<entry><type>box</type></entry>
<entry><type>box</type></entry>
<entry>points to box</entry>
<entry>points to box</entry>
<entry><literal>box(point '(0,0)', point '(1,1)')</literal></entry>
<entry><literal>box(point '(0,0)', point '(1,1)')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>box</function>(<type>polygon</type>)</literal></entry>
<entry><literal><function>box</function>(<type>polygon</type>)</literal></entry>
<entry><type>box</type></entry>
<entry><type>box</type></entry>
<entry>polygon to box</entry>
<entry>polygon to box</entry>
<entry><literal>box(polygon '((0,0),(1,1),(2,0))')</literal></entry>
<entry><literal>box(polygon '((0,0),(1,1),(2,0))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>circle</function>(<type>box</type>)</literal></entry>
<entry><literal><function>circle</function>(<type>box</type>)</literal></entry>
<entry><type>circle</type></entry>
<entry><type>circle</type></entry>
<entry>box to circle</entry>
<entry>box to circle</entry>
<entry><literal>circle(box '((0,0),(1,1))')</literal></entry>
<entry><literal>circle(box '((0,0),(1,1))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>circle</function>(<type>point</type>, <type>double precision</type>)</literal></entry>
<entry><literal><function>circle</function>(<type>point</type>, <type>double precision</type>)</literal></entry>
<entry><type>circle</type></entry>
<entry><type>circle</type></entry>
<entry>point and radius to circle</entry>
<entry>point and radius to circle</entry>
<entry><literal>circle(point '(0,0)', 2.0)</literal></entry>
<entry><literal>circle(point '(0,0)', 2.0)</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>lseg</function>(<type>box</type>)</literal></entry>
<entry><literal><function>lseg</function>(<type>box</type>)</literal></entry>
<entry><type>lseg</type></entry>
<entry><type>lseg</type></entry>
<entry>box diagonal to line segment</entry>
<entry>box diagonal to line segment</entry>
<entry><literal>lseg(box '((-1,0),(1,0))')</literal></entry>
<entry><literal>lseg(box '((-1,0),(1,0))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>lseg</function>(<type>point</type>, <type>point</type>)</literal></entry>
<entry><literal><function>lseg</function>(<type>point</type>, <type>point</type>)</literal></entry>
<entry><type>lseg</type></entry>
<entry><type>lseg</type></entry>
<entry>points to line segment</entry>
<entry>points to line segment</entry>
<entry><literal>lseg(point '(-1,0)', point '(1,0)')</literal></entry>
<entry><literal>lseg(point '(-1,0)', point '(1,0)')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>path</function>(<type>polygon</type>)</literal></entry>
<entry><literal><function>path</function>(<type>polygon</type>)</literal></entry>
<entry><type>point</type></entry>
<entry><type>point</type></entry>
<entry>polygon to path</entry>
<entry>polygon to path</entry>
<entry><literal>path(polygon '((0,0),(1,1),(2,0))')</literal></entry>
<entry><literal>path(polygon '((0,0),(1,1),(2,0))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>point</function>(<type>circle</type>)</literal></entry>
<entry><literal><function>point</function>(<type>circle</type>)</literal></entry>
<entry><type>point</type></entry>
<entry><type>point</type></entry>
<entry>center of circle</entry>
<entry>center of circle</entry>
<entry><literal>point(circle '((0,0),2.0)')</literal></entry>
<entry><literal>point(circle '((0,0),2.0)')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>point</function>(<type>lseg</type>, <type>lseg</type>)</literal></entry>
<entry><literal><function>point</function>(<type>lseg</type>, <type>lseg</type>)</literal></entry>
<entry><type>point</type></entry>
<entry><type>point</type></entry>
<entry>intersection</entry>
<entry>intersection</entry>
<entry><literal>point(lseg '((-1,0),(1,0))', lseg '((-2,-2),(2,2))')</literal></entry>
<entry><literal>point(lseg '((-1,0),(1,0))', lseg '((-2,-2),(2,2))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>point</function>(<type>polygon</type>)</literal></entry>
<entry><literal><function>point</function>(<type>polygon</type>)</literal></entry>
<entry><type>point</type></entry>
<entry><type>point</type></entry>
<entry>center of polygon</entry>
<entry>center of polygon</entry>
<entry><literal>point(polygon '((0,0),(1,1),(2,0))')</literal></entry>
<entry><literal>point(polygon '((0,0),(1,1),(2,0))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>polygon</function>(<type>box</type>)</literal></entry>
<entry><literal><function>polygon</function>(<type>box</type>)</literal></entry>
<entry><type>polygon</type></entry>
<entry><type>polygon</type></entry>
<entry>box to 4-point polygon</entry>
<entry>box to 4-point polygon</entry>
<entry><literal>polygon(box '((0,0),(1,1))')</literal></entry>
<entry><literal>polygon(box '((0,0),(1,1))')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>polygon</function>(<type>circle</type>)</literal></entry>
<entry><literal><function>polygon</function>(<type>circle</type>)</literal></entry>
<entry><type>polygon</type></entry>
<entry><type>polygon</type></entry>
<entry>circle to 12-point polygon</entry>
<entry>circle to 12-point polygon</entry>
<entry><literal>polygon(circle '((0,0),2.0)')</literal></entry>
<entry><literal>polygon(circle '((0,0),2.0)')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>polygon</function>(<replaceable class="parameter">npts</replaceable>, <type>circle</type>)</literal></entry>
<entry><literal><function>polygon</function>(<replaceable class="parameter">npts</replaceable>, <type>circle</type>)</literal></entry>
<entry><type>polygon</type></entry>
<entry><type>polygon</type></entry>
<entry>circle to <replaceable class="parameter">npts</replaceable>-point polygon</entry>
<entry>circle to <replaceable class="parameter">npts</replaceable>-point polygon</entry>
<entry><literal>polygon(12, circle '((0,0),2.0)')</literal></entry>
<entry><literal>polygon(12, circle '((0,0),2.0)')</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>polygon</function>(<type>path</type>)</literal></entry>
<entry><literal><function>polygon</function>(<type>path</type>)</literal></entry>
<entry><type>polygon</type></entry>
<entry><type>polygon</type></entry>
<entry>path to polygon</entry>
<entry>path to polygon</entry>
<entry><literal>polygon(path '((0,0),(1,1),(2,0))')</literal></entry>
<entry><literal>polygon(path '((0,0),(1,1),(2,0))')</literal></entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -6129,7 +6129,7 @@ SELECT TIMESTAMP 'now';
...
@@ -6129,7 +6129,7 @@ SELECT TIMESTAMP 'now';
<sect1 id="functions-net">
<sect1 id="functions-net">
<title>Network Address
Type Function
s</title>
<title>Network Address
Functions and Operator
s</title>
<para>
<para>
<xref linkend="cidr-inet-operators-table"> shows the operators
<xref linkend="cidr-inet-operators-table"> shows the operators
...
@@ -6147,61 +6147,61 @@ SELECT TIMESTAMP 'now';
...
@@ -6147,61 +6147,61 @@ SELECT TIMESTAMP 'now';
<tgroup cols="3">
<tgroup cols="3">
<thead>
<thead>
<row>
<row>
<entry>Operator</entry>
<entry>Operator</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry> <literal><</literal> </entry>
<entry> <literal><</literal> </entry>
<entry>is less than</entry>
<entry>is less than</entry>
<entry><literal>inet '192.168.1.5' < inet '192.168.1.6'</literal></entry>
<entry><literal>inet '192.168.1.5' < inet '192.168.1.6'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal><=</literal> </entry>
<entry> <literal><=</literal> </entry>
<entry>is less than or equal</entry>
<entry>is less than or equal</entry>
<entry><literal>inet '192.168.1.5' <= inet '192.168.1.5'</literal></entry>
<entry><literal>inet '192.168.1.5' <= inet '192.168.1.5'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>=</literal> </entry>
<entry> <literal>=</literal> </entry>
<entry>equals</entry>
<entry>equals</entry>
<entry><literal>inet '192.168.1.5' = inet '192.168.1.5'</literal></entry>
<entry><literal>inet '192.168.1.5' = inet '192.168.1.5'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>>=</literal> </entry>
<entry> <literal>>=</literal> </entry>
<entry>is greater or equal</entry>
<entry>is greater or equal</entry>
<entry><literal>inet '192.168.1.5' >= inet '192.168.1.5'</literal></entry>
<entry><literal>inet '192.168.1.5' >= inet '192.168.1.5'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>></literal> </entry>
<entry> <literal>></literal> </entry>
<entry>is greater than</entry>
<entry>is greater than</entry>
<entry><literal>inet '192.168.1.5' > inet '192.168.1.4'</literal></entry>
<entry><literal>inet '192.168.1.5' > inet '192.168.1.4'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal><></literal> </entry>
<entry> <literal><></literal> </entry>
<entry>is not equal</entry>
<entry>is not equal</entry>
<entry><literal>inet '192.168.1.5' <> inet '192.168.1.4'</literal></entry>
<entry><literal>inet '192.168.1.5' <> inet '192.168.1.4'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal><<</literal> </entry>
<entry> <literal><<</literal> </entry>
<entry>is contained within</entry>
<entry>is contained within</entry>
<entry><literal>inet '192.168.1.5' << inet '192.168.1/24'</literal></entry>
<entry><literal>inet '192.168.1.5' << inet '192.168.1/24'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal><<=</literal> </entry>
<entry> <literal><<=</literal> </entry>
<entry>is contained within or equals</entry>
<entry>is contained within or equals</entry>
<entry><literal>inet '192.168.1/24' <<= inet '192.168.1/24'</literal></entry>
<entry><literal>inet '192.168.1/24' <<= inet '192.168.1/24'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>>></literal> </entry>
<entry> <literal>>></literal> </entry>
<entry>contains</entry>
<entry>contains</entry>
<entry><literal>inet '192.168.1/24' >> inet '192.168.1.5'</literal></entry>
<entry><literal>inet '192.168.1/24' >> inet '192.168.1.5'</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>>>=</literal> </entry>
<entry> <literal>>>=</literal> </entry>
<entry>contains or equals</entry>
<entry>contains or equals</entry>
<entry><literal>inet '192.168.1/24' >>= inet '192.168.1/24'</literal></entry>
<entry><literal>inet '192.168.1/24' >>= inet '192.168.1/24'</literal></entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -6223,76 +6223,76 @@ SELECT TIMESTAMP 'now';
...
@@ -6223,76 +6223,76 @@ SELECT TIMESTAMP 'now';
<tgroup cols="5">
<tgroup cols="5">
<thead>
<thead>
<row>
<row>
<entry>Function</entry>
<entry>Function</entry>
<entry>Return Type</entry>
<entry>Return Type</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
<entry>Result</entry>
<entry>Result</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry><literal><function>broadcast</function>(<type>inet</type>)</literal></entry>
<entry><literal><function>broadcast</function>(<type>inet</type>)</literal></entry>
<entry><type>inet</type></entry>
<entry><type>inet</type></entry>
<entry>broadcast address for network</entry>
<entry>broadcast address for network</entry>
<entry><literal>broadcast('192.168.1.5/24')</literal></entry>
<entry><literal>broadcast('192.168.1.5/24')</literal></entry>
<entry><literal>192.168.1.255/24</literal></entry>
<entry><literal>192.168.1.255/24</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>host</function>(<type>inet</type>)</literal></entry>
<entry><literal><function>host</function>(<type>inet</type>)</literal></entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>extract IP address as text</entry>
<entry>extract IP address as text</entry>
<entry><literal>host('192.168.1.5/24')</literal></entry>
<entry><literal>host('192.168.1.5/24')</literal></entry>
<entry><literal>192.168.1.5</literal></entry>
<entry><literal>192.168.1.5</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>masklen</function>(<type>inet</type>)</literal></entry>
<entry><literal><function>masklen</function>(<type>inet</type>)</literal></entry>
<entry><type>integer</type></entry>
<entry><type>integer</type></entry>
<entry>extract netmask length</entry>
<entry>extract netmask length</entry>
<entry><literal>masklen('192.168.1.5/24')</literal></entry>
<entry><literal>masklen('192.168.1.5/24')</literal></entry>
<entry><literal>24</literal></entry>
<entry><literal>24</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>set_masklen</function>(<type>inet</type>, <type>integer</type>)</literal></entry>
<entry><literal><function>set_masklen</function>(<type>inet</type>, <type>integer</type>)</literal></entry>
<entry><type>inet</type></entry>
<entry><type>inet</type></entry>
<entry>set netmask length for <type>inet</type> value</entry>
<entry>set netmask length for <type>inet</type> value</entry>
<entry><literal>set_masklen('192.168.1.5/24', 16)</literal></entry>
<entry><literal>set_masklen('192.168.1.5/24', 16)</literal></entry>
<entry><literal>192.168.1.5/16</literal></entry>
<entry><literal>192.168.1.5/16</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>netmask</function>(<type>inet</type>)</literal></entry>
<entry><literal><function>netmask</function>(<type>inet</type>)</literal></entry>
<entry><type>inet</type></entry>
<entry><type>inet</type></entry>
<entry>construct netmask for network</entry>
<entry>construct netmask for network</entry>
<entry><literal>netmask('192.168.1.5/24')</literal></entry>
<entry><literal>netmask('192.168.1.5/24')</literal></entry>
<entry><literal>255.255.255.0</literal></entry>
<entry><literal>255.255.255.0</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>hostmask</function>(<type>inet</type>)</literal></entry>
<entry><literal><function>hostmask</function>(<type>inet</type>)</literal></entry>
<entry><type>inet</type></entry>
<entry><type>inet</type></entry>
<entry>construct host mask for network</entry>
<entry>construct host mask for network</entry>
<entry><literal>hostmask('192.168.23.20/30')</literal></entry>
<entry><literal>hostmask('192.168.23.20/30')</literal></entry>
<entry><literal>0.0.0.3</literal></entry>
<entry><literal>0.0.0.3</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>network</function>(<type>inet</type>)</literal></entry>
<entry><literal><function>network</function>(<type>inet</type>)</literal></entry>
<entry><type>cidr</type></entry>
<entry><type>cidr</type></entry>
<entry>extract network part of address</entry>
<entry>extract network part of address</entry>
<entry><literal>network('192.168.1.5/24')</literal></entry>
<entry><literal>network('192.168.1.5/24')</literal></entry>
<entry><literal>192.168.1.0/24</literal></entry>
<entry><literal>192.168.1.0/24</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>text</function>(<type>inet</type>)</literal></entry>
<entry><literal><function>text</function>(<type>inet</type>)</literal></entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>extract IP address and netmask length as text</entry>
<entry>extract IP address and netmask length as text</entry>
<entry><literal>text(inet '192.168.1.5')</literal></entry>
<entry><literal>text(inet '192.168.1.5')</literal></entry>
<entry><literal>192.168.1.5/32</literal></entry>
<entry><literal>192.168.1.5/32</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>abbrev</function>(<type>inet</type>)</literal></entry>
<entry><literal><function>abbrev</function>(<type>inet</type>)</literal></entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>abbreviated display format as text</entry>
<entry>abbreviated display format as text</entry>
<entry><literal>abbrev(cidr '10.1.0.0/16')</literal></entry>
<entry><literal>abbrev(cidr '10.1.0.0/16')</literal></entry>
<entry><literal>10.1/16</literal></entry>
<entry><literal>10.1/16</literal></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>family</function>(<type>inet</type>)</literal></entry>
<entry><literal><function>family</function>(<type>inet</type>)</literal></entry>
...
@@ -6322,20 +6322,20 @@ SELECT TIMESTAMP 'now';
...
@@ -6322,20 +6322,20 @@ SELECT TIMESTAMP 'now';
<tgroup cols="5">
<tgroup cols="5">
<thead>
<thead>
<row>
<row>
<entry>Function</entry>
<entry>Function</entry>
<entry>Return Type</entry>
<entry>Return Type</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
<entry>Result</entry>
<entry>Result</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry><literal><function>trunc</function>(<type>macaddr</type>)</literal></entry>
<entry><literal><function>trunc</function>(<type>macaddr</type>)</literal></entry>
<entry><type>macaddr</type></entry>
<entry><type>macaddr</type></entry>
<entry>set last 3 bytes to zero</entry>
<entry>set last 3 bytes to zero</entry>
<entry><literal>trunc(macaddr '12:34:56:78:90:ab')</literal></entry>
<entry><literal>trunc(macaddr '12:34:56:78:90:ab')</literal></entry>
<entry><literal>12:34:56:00:00:00</literal></entry>
<entry><literal>12:34:56:00:00:00</literal></entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -6387,24 +6387,24 @@ SELECT TIMESTAMP 'now';
...
@@ -6387,24 +6387,24 @@ SELECT TIMESTAMP 'now';
<tbody>
<tbody>
<row>
<row>
<entry><literal><function>nextval</function>(<type>text</type>)</literal></entry>
<entry><literal><function>nextval</function>(<type>text</type>)</literal></entry>
<entry><type>bigint</type></entry>
<entry><type>bigint</type></entry>
<entry>Advance sequence and return new value</entry>
<entry>Advance sequence and return new value</entry>
</row>
</row>
<row>
<row>
<entry><literal><function>currval</function>(<type>text</type>)</literal></entry>
<entry><literal><function>currval</function>(<type>text</type>)</literal></entry>
<entry><type>bigint</type></entry>
<entry><type>bigint</type></entry>
<entry>Return value most recently obtained with <function>nextval</function></entry>
<entry>Return value most recently obtained with <function>nextval</function></entry>
</row>
</row>
<row>
<row>
<entry><literal><function>setval</function>(<type>text</type>, <type>bigint</type>)</literal></entry>
<entry><literal><function>setval</function>(<type>text</type>, <type>bigint</type>)</literal></entry>
<entry><type>bigint</type></entry>
<entry><type>bigint</type></entry>
<entry>Set sequence's current value</entry>
<entry>Set sequence's current value</entry>
</row>
</row>
<row>
<row>
<entry><literal><function>setval</function>(<type>text</type>, <type>bigint</type>, <type>boolean</type>)</literal></entry>
<entry><literal><function>setval</function>(<type>text</type>, <type>bigint</type>, <type>boolean</type>)</literal></entry>
<entry><type>bigint</type></entry>
<entry><type>bigint</type></entry>
<entry>Set sequence's current value and <literal>is_called</literal> flag</entry>
<entry>Set sequence's current value and <literal>is_called</literal> flag</entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -6440,9 +6440,9 @@ nextval('foo') <lineannotation>searches search path for <literal>fo
...
@@ -6440,9 +6440,9 @@ nextval('foo') <lineannotation>searches search path for <literal>fo
<listitem>
<listitem>
<para>
<para>
Advance the sequence object to its next value and return that
Advance the sequence object to its next value and return that
value. This is done atomically: even if multiple sessions
value. This is done atomically: even if multiple sessions
execute <function>nextval</function> concurrently, each will safely receive
execute <function>nextval</function> concurrently, each will safely receive
a distinct sequence value.
a distinct sequence value.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -6452,11 +6452,12 @@ nextval('foo') <lineannotation>searches search path for <literal>fo
...
@@ -6452,11 +6452,12 @@ nextval('foo') <lineannotation>searches search path for <literal>fo
<listitem>
<listitem>
<para>
<para>
Return the value most recently obtained by <function>nextval</function>
Return the value most recently obtained by <function>nextval</function>
for this sequence in the current session. (An error is
for this sequence in the current session. (An error is
reported if <function>nextval</function> has never been called for this
reported if <function>nextval</function> has never been called for this
sequence in this session.) Notice that because this is returning
sequence in this session.) Notice that because this is returning
a session-local value, it gives a predictable answer even if other
a session-local value, it gives a predictable answer whether or not
sessions are executing <function>nextval</function> meanwhile.
other sessions have executed <function>nextval</function> since the
current session did.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -6466,15 +6467,15 @@ nextval('foo') <lineannotation>searches search path for <literal>fo
...
@@ -6466,15 +6467,15 @@ nextval('foo') <lineannotation>searches search path for <literal>fo
<listitem>
<listitem>
<para>
<para>
Reset the sequence object's counter value. The two-parameter
Reset the sequence object's counter value. The two-parameter
form sets the sequence's <literal>last_value</literal> field to the specified
form sets the sequence's <literal>last_value</literal> field to the specified
value and sets its <literal>is_called</literal> field to <literal>true</literal>,
value and sets its <literal>is_called</literal> field to <literal>true</literal>,
meaning that the next <function>nextval</function> will advance the sequence
meaning that the next <function>nextval</function> will advance the sequence
before returning a value. In the three-parameter form,
before returning a value. In the three-parameter form,
<literal>is_called</literal> may be set either <literal>true</literal> or
<literal>is_called</literal> may be set either <literal>true</literal> or
<literal>false</literal>. If it's set to <literal>false</literal>,
<literal>false</literal>. If it's set to <literal>false</literal>,
the next <function>nextval</function> will return exactly the specified
the next <function>nextval</function> will return exactly the specified
value, and sequence advancement commences with the following
value, and sequence advancement commences with the following
<function>nextval</function>. For example,
<function>nextval</function>. For example,
<screen>
<screen>
SELECT setval('foo', 42); <lineannotation>Next <function>nextval</> will return 43</lineannotation>
SELECT setval('foo', 42); <lineannotation>Next <function>nextval</> will return 43</lineannotation>
...
@@ -6483,7 +6484,7 @@ SELECT setval('foo', 42, false); <lineannotation>Next <function>nextval</> wi
...
@@ -6483,7 +6484,7 @@ SELECT setval('foo', 42, false); <lineannotation>Next <function>nextval</> wi
</screen>
</screen>
The result returned by <function>setval</function> is just the value of its
The result returned by <function>setval</function> is just the value of its
second argument.
second argument.
</para>
</para>
</listitem>
</listitem>
</varlistentry>
</varlistentry>
...
@@ -6719,81 +6720,81 @@ SELECT NULLIF(value, '(none)') ...
...
@@ -6719,81 +6720,81 @@ SELECT NULLIF(value, '(none)') ...
<tgroup cols="4">
<tgroup cols="4">
<thead>
<thead>
<row>
<row>
<entry>Operator</entry>
<entry>Operator</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
<entry>Result</entry>
<entry>Result</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry> <literal>=</literal> </entry>
<entry> <literal>=</literal> </entry>
<entry>equal</entry>
<entry>equal</entry>
<entry><literal>ARRAY[1.1,2.1,3.1]::int[] = ARRAY[1,2,3]</literal></entry>
<entry><literal>ARRAY[1.1,2.1,3.1]::int[] = ARRAY[1,2,3]</literal></entry>
<entry><literal>t</literal></entry>
<entry><literal>t</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal><></literal> </entry>
<entry> <literal><></literal> </entry>
<entry>not equal</entry>
<entry>not equal</entry>
<entry><literal>ARRAY[1,2,3] <> ARRAY[1,2,4]</literal></entry>
<entry><literal>ARRAY[1,2,3] <> ARRAY[1,2,4]</literal></entry>
<entry><literal>t</literal></entry>
<entry><literal>t</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal><</literal> </entry>
<entry> <literal><</literal> </entry>
<entry>less than</entry>
<entry>less than</entry>
<entry><literal>ARRAY[1,2,3] < ARRAY[1,2,4]</literal></entry>
<entry><literal>ARRAY[1,2,3] < ARRAY[1,2,4]</literal></entry>
<entry><literal>t</literal></entry>
<entry><literal>t</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>></literal> </entry>
<entry> <literal>></literal> </entry>
<entry>greater than</entry>
<entry>greater than</entry>
<entry><literal>ARRAY[1,4,3] > ARRAY[1,2,4]</literal></entry>
<entry><literal>ARRAY[1,4,3] > ARRAY[1,2,4]</literal></entry>
<entry><literal>t</literal></entry>
<entry><literal>t</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal><=</literal> </entry>
<entry> <literal><=</literal> </entry>
<entry>less than or equal</entry>
<entry>less than or equal</entry>
<entry><literal>ARRAY[1,2,3] <= ARRAY[1,2,3]</literal></entry>
<entry><literal>ARRAY[1,2,3] <= ARRAY[1,2,3]</literal></entry>
<entry><literal>t</literal></entry>
<entry><literal>t</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>>=</literal> </entry>
<entry> <literal>>=</literal> </entry>
<entry>greater than or equal</entry>
<entry>greater than or equal</entry>
<entry><literal>ARRAY[1,4,3] >= ARRAY[1,4,3]</literal></entry>
<entry><literal>ARRAY[1,4,3] >= ARRAY[1,4,3]</literal></entry>
<entry><literal>t</literal></entry>
<entry><literal>t</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>||</literal> </entry>
<entry> <literal>||</literal> </entry>
<entry>array-to-array concatenation</entry>
<entry>array-to-array concatenation</entry>
<entry><literal>ARRAY[1,2,3] || ARRAY[4,5,6]</literal></entry>
<entry><literal>ARRAY[1,2,3] || ARRAY[4,5,6]</literal></entry>
<entry><literal>{1,2,3,4,5,6}</literal></entry>
<entry><literal>{1,2,3,4,5,6}</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>||</literal> </entry>
<entry> <literal>||</literal> </entry>
<entry>array-to-array concatenation</entry>
<entry>array-to-array concatenation</entry>
<entry><literal>ARRAY[1,2,3] || ARRAY[[4,5,6],[7,8,9]]</literal></entry>
<entry><literal>ARRAY[1,2,3] || ARRAY[[4,5,6],[7,8,9]]</literal></entry>
<entry><literal>{{1,2,3},{4,5,6},{7,8,9}}</literal></entry>
<entry><literal>{{1,2,3},{4,5,6},{7,8,9}}</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>||</literal> </entry>
<entry> <literal>||</literal> </entry>
<entry>element-to-array concatenation</entry>
<entry>element-to-array concatenation</entry>
<entry><literal>3 || ARRAY[4,5,6]</literal></entry>
<entry><literal>3 || ARRAY[4,5,6]</literal></entry>
<entry><literal>{3,4,5,6}</literal></entry>
<entry><literal>{3,4,5,6}</literal></entry>
</row>
</row>
<row>
<row>
<entry> <literal>||</literal> </entry>
<entry> <literal>||</literal> </entry>
<entry>array-to-element concatenation</entry>
<entry>array-to-element concatenation</entry>
<entry><literal>ARRAY[4,5,6] || 7</literal></entry>
<entry><literal>ARRAY[4,5,6] || 7</literal></entry>
<entry><literal>{4,5,6,7}</literal></entry>
<entry><literal>{4,5,6,7}</literal></entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -6815,109 +6816,109 @@ SELECT NULLIF(value, '(none)') ...
...
@@ -6815,109 +6816,109 @@ SELECT NULLIF(value, '(none)') ...
<tgroup cols="5">
<tgroup cols="5">
<thead>
<thead>
<row>
<row>
<entry>Function</entry>
<entry>Function</entry>
<entry>Return Type</entry>
<entry>Return Type</entry>
<entry>Description</entry>
<entry>Description</entry>
<entry>Example</entry>
<entry>Example</entry>
<entry>Result</entry>
<entry>Result</entry>
</row>
</row>
</thead>
</thead>
<tbody>
<tbody>
<row>
<row>
<entry>
<entry>
<literal>
<literal>
<function>array_cat</function>
<function>array_cat</function>
(<type>anyarray</type>, <type>anyarray</type>)
(<type>anyarray</type>, <type>anyarray</type>)
</literal>
</literal>
</entry>
</entry>
<entry><type>anyarray</type></entry>
<entry><type>anyarray</type></entry>
<entry>concatenate two arrays</entry>
<entry>concatenate two arrays</entry>
<entry><literal>array_cat(ARRAY[1,2,3], ARRAY[4,5])</literal></entry>
<entry><literal>array_cat(ARRAY[1,2,3], ARRAY[4,5])</literal></entry>
<entry><literal>{1,2,3,4,5}</literal></entry>
<entry><literal>{1,2,3,4,5}</literal></entry>
</row>
</row>
<row>
<row>
<entry>
<entry>
<literal>
<literal>
<function>array_append</function>
<function>array_append</function>
(<type>anyarray</type>, <type>anyelement</type>)
(<type>anyarray</type>, <type>anyelement</type>)
</literal>
</literal>
</entry>
</entry>
<entry><type>anyarray</type></entry>
<entry><type>anyarray</type></entry>
<entry>append an element to the end of an array</entry>
<entry>append an element to the end of an array</entry>
<entry><literal>array_append(ARRAY[1,2], 3)</literal></entry>
<entry><literal>array_append(ARRAY[1,2], 3)</literal></entry>
<entry><literal>{1,2,3}</literal></entry>
<entry><literal>{1,2,3}</literal></entry>
</row>
</row>
<row>
<row>
<entry>
<entry>
<literal>
<literal>
<function>array_prepend</function>
<function>array_prepend</function>
(<type>anyelement</type>, <type>anyarray</type>)
(<type>anyelement</type>, <type>anyarray</type>)
</literal>
</literal>
</entry>
</entry>
<entry><type>anyarray</type></entry>
<entry><type>anyarray</type></entry>
<entry>append an element to the beginning of an array</entry>
<entry>append an element to the beginning of an array</entry>
<entry><literal>array_prepend(1, ARRAY[2,3])</literal></entry>
<entry><literal>array_prepend(1, ARRAY[2,3])</literal></entry>
<entry><literal>{1,2,3}</literal></entry>
<entry><literal>{1,2,3}</literal></entry>
</row>
</row>
<row>
<row>
<entry>
<entry>
<literal>
<literal>
<function>array_dims</function>
<function>array_dims</function>
(<type>anyarray</type>)
(<type>anyarray</type>)
</literal>
</literal>
</entry>
</entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>returns a text representation of array's dimensions</entry>
<entry>returns a text representation of array's dimensions</entry>
<entry><literal>array_dims(array[[1,2,3], [4,5,6]])</literal></entry>
<entry><literal>array_dims(array[[1,2,3], [4,5,6]])</literal></entry>
<entry><literal>[1:2][1:3]</literal></entry>
<entry><literal>[1:2][1:3]</literal></entry>
</row>
</row>
<row>
<row>
<entry>
<entry>
<literal>
<literal>
<function>array_lower</function>
<function>array_lower</function>
(<type>anyarray</type>, <type>integer</type>)
(<type>anyarray</type>, <type>integer</type>)
</literal>
</literal>
</entry>
</entry>
<entry><type>integer</type></entry>
<entry><type>integer</type></entry>
<entry>returns lower bound of the requested array dimension</entry>
<entry>returns lower bound of the requested array dimension</entry>
<entry><literal>array_lower(array_prepend(0, ARRAY[1,2,3]), 1)</literal></entry>
<entry><literal>array_lower(array_prepend(0, ARRAY[1,2,3]), 1)</literal></entry>
<entry><literal>0</literal></entry>
<entry><literal>0</literal></entry>
</row>
</row>
<row>
<row>
<entry>
<entry>
<literal>
<literal>
<function>array_upper</function>
<function>array_upper</function>
(<type>anyarray</type>, <type>integer</type>)
(<type>anyarray</type>, <type>integer</type>)
</literal>
</literal>
</entry>
</entry>
<entry><type>integer</type></entry>
<entry><type>integer</type></entry>
<entry>returns upper bound of the requested array dimension</entry>
<entry>returns upper bound of the requested array dimension</entry>
<entry><literal>array_upper(ARRAY[1,2,3,4], 1)</literal></entry>
<entry><literal>array_upper(ARRAY[1,2,3,4], 1)</literal></entry>
<entry><literal>4</literal></entry>
<entry><literal>4</literal></entry>
</row>
</row>
<row>
<row>
<entry>
<entry>
<literal>
<literal>
<function>array_to_string</function>
<function>array_to_string</function>
(<type>anyarray</type>, <type>text</type>)
(<type>anyarray</type>, <type>text</type>)
</literal>
</literal>
</entry>
</entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>concatenates array elements using provided delimiter</entry>
<entry>concatenates array elements using provided delimiter</entry>
<entry><literal>array_to_string(array[1, 2, 3], '~^~')</literal></entry>
<entry><literal>array_to_string(array[1, 2, 3], '~^~')</literal></entry>
<entry><literal>1~^~2~^~3</literal></entry>
<entry><literal>1~^~2~^~3</literal></entry>
</row>
</row>
<row>
<row>
<entry>
<entry>
<literal>
<literal>
<function>string_to_array</function>
<function>string_to_array</function>
(<type>text</type>, <type>text</type>)
(<type>text</type>, <type>text</type>)
</literal>
</literal>
</entry>
</entry>
<entry><type>text[]</type></entry>
<entry><type>text[]</type></entry>
<entry>splits string into array elements using provided delimiter</entry>
<entry>splits string into array elements using provided delimiter</entry>
<entry><literal>string_to_array( 'xx~^~yy~^~zz', '~^~')</literal></entry>
<entry><literal>string_to_array( 'xx~^~yy~^~zz', '~^~')</literal></entry>
<entry><literal>{xx,yy,zz}</literal></entry>
<entry><literal>{xx,yy,zz}</literal></entry>
</row>
</row>
</tbody>
</tbody>
</tgroup>
</tgroup>
...
@@ -8271,7 +8272,8 @@ SELECT has_table_privilege('myschema.mytable', 'select');
...
@@ -8271,7 +8272,8 @@ SELECT has_table_privilege('myschema.mytable', 'select');
can access a function in a particular way. The possibilities for its
can access a function in a particular way. The possibilities for its
arguments are analogous to <function>has_table_privilege</function>.
arguments are analogous to <function>has_table_privilege</function>.
When specifying a function by a text string rather than by OID,
When specifying a function by a text string rather than by OID,
the allowed input is the same as for the <type>regprocedure</> data type.
the allowed input is the same as for the <type>regprocedure</> data type
(see <xref linkend="datatype-oid">).
The desired access privilege type must evaluate to
The desired access privilege type must evaluate to
<literal>EXECUTE</literal>.
<literal>EXECUTE</literal>.
An example is:
An example is:
...
@@ -8781,8 +8783,8 @@ SELECT set_config('log_statement_stats', 'off', false);
...
@@ -8781,8 +8783,8 @@ SELECT set_config('log_statement_stats', 'off', false);
<tbody>
<tbody>
<row>
<row>
<entry>
<entry>
<literal><function>pg_cancel_backend</function>(<parameter>pid</parameter>)</literal>
<literal><function>pg_cancel_backend</function>(<parameter>pid</parameter>)</literal>
</entry>
</entry>
<entry><type>int</type></entry>
<entry><type>int</type></entry>
<entry>Cancel a backend's current query</entry>
<entry>Cancel a backend's current query</entry>
</row>
</row>
...
@@ -8827,15 +8829,15 @@ SELECT set_config('log_statement_stats', 'off', false);
...
@@ -8827,15 +8829,15 @@ SELECT set_config('log_statement_stats', 'off', false);
<tbody>
<tbody>
<row>
<row>
<entry>
<entry>
<literal><function>pg_start_backup</function>(<parameter>label_text</parameter>)</literal>
<literal><function>pg_start_backup</function>(<parameter>label_text</parameter>)</literal>
</entry>
</entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>Set up for performing on-line backup</entry>
<entry>Set up for performing on-line backup</entry>
</row>
</row>
<row>
<row>
<entry>
<entry>
<literal><function>pg_stop_backup</function>()</literal>
<literal><function>pg_stop_backup</function>()</literal>
</entry>
</entry>
<entry><type>text</type></entry>
<entry><type>text</type></entry>
<entry>Finish performing on-line backup</entry>
<entry>Finish performing on-line backup</entry>
</row>
</row>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment