<!--
-$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.284 2005/09/09 02:31:48 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.285 2005/09/14 21:14:26 neilc Exp $
PostgreSQL documentation
-->
<primary>BETWEEN</primary>
</indexterm>
In addition to the comparison operators, the special
- <token>BETWEEN</token> construct is available.<indexterm><primary>BETWEEN</primary></indexterm>
+ <token>BETWEEN</token> construct is available.
<synopsis>
<replaceable>a</replaceable> BETWEEN <replaceable>x</replaceable> AND <replaceable>y</replaceable>
</synopsis>
boundary cases may therefore vary depending on the host system.
</para>
+ <indexterm>
+ <primary>abs</primary>
+ </indexterm>
+ <indexterm>
+ <primary>cbrt</primary>
+ </indexterm>
+ <indexterm>
+ <primary>ceiling</primary>
+ </indexterm>
+ <indexterm>
+ <primary>degrees</primary>
+ </indexterm>
+ <indexterm>
+ <primary>exp</primary>
+ </indexterm>
+ <indexterm>
+ <primary>floor</primary>
+ </indexterm>
+ <indexterm>
+ <primary>ln</primary>
+ </indexterm>
+ <indexterm>
+ <primary>log</primary>
+ </indexterm>
+ <indexterm>
+ <primary>mod</primary>
+ </indexterm>
+ <indexterm>
+ <primary>π</primary>
+ </indexterm>
+ <indexterm>
+ <primary>power</primary>
+ </indexterm>
+ <indexterm>
+ <primary>radians</primary>
+ </indexterm>
+ <indexterm>
+ <primary>random</primary>
+ </indexterm>
+ <indexterm>
+ <primary>round</primary>
+ </indexterm>
+ <indexterm>
+ <primary>setseed</primary>
+ </indexterm>
+ <indexterm>
+ <primary>sign</primary>
+ </indexterm>
+ <indexterm>
+ <primary>sqrt</primary>
+ </indexterm>
+ <indexterm>
+ <primary>trunc</primary>
+ </indexterm>
+ <indexterm>
+ <primary>width_bucket</primary>
+ </indexterm>
+
<table id="functions-math-func-table">
<title>Mathematical Functions</title>
<tgroup cols="5">
</row>
<row>
- <entry><literal><function>round</function>(<parameter>v</parameter> <type>numeric</type>, <parameter>s</parameter> <type>integer</type>)</literal></entry>
+ <entry><literal><function>round</function>(<parameter>v</parameter> <type>numeric</type>, <parameter>s</parameter> <type>int</type>)</literal></entry>
<entry><type>numeric</type></entry>
<entry>round to <parameter>s</parameter> decimal places</entry>
<entry><literal>round(42.4382, 2)</literal></entry>
<row>
<entry><literal><function>setseed</function>(<type>dp</type>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>set seed for subsequent <literal>random()</literal> calls</entry>
<entry><literal>setseed(0.54823)</literal></entry>
<entry><literal>1177314959</literal></entry>
</row>
<row>
- <entry><literal><function>trunc</function>(<parameter>v</parameter> <type>numeric</type>, <parameter>s</parameter> <type>integer</type>)</literal></entry>
+ <entry><literal><function>trunc</function>(<parameter>v</parameter> <type>numeric</type>, <parameter>s</parameter> <type>int</type>)</literal></entry>
<entry><type>numeric</type></entry>
<entry>truncate to <parameter>s</parameter> decimal places</entry>
<entry><literal>trunc(42.4382, 2)</literal></entry>
</row>
<row>
- <entry><literal><function>width_bucket</function>(<parameter>op</parameter> <type>numeric</type>, <parameter>b1</parameter> <type>numeric</type>, <parameter>b2</parameter> <type>numeric</type>, <parameter>count</parameter> <type>integer</type>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><literal><function>width_bucket</function>(<parameter>op</parameter> <type>numeric</type>, <parameter>b1</parameter> <type>numeric</type>, <parameter>b2</parameter> <type>numeric</type>, <parameter>count</parameter> <type>int</type>)</literal></entry>
+ <entry><type>int</type></entry>
<entry>return the bucket to which <parameter>operand</> would
be assigned in an equidepth histogram with <parameter>count</>
buckets, an upper bound of <parameter>b1</>, and a lower bound
precision</type>.
</para>
+ <indexterm>
+ <primary>acos</primary>
+ </indexterm>
+ <indexterm>
+ <primary>asin</primary>
+ </indexterm>
+ <indexterm>
+ <primary>atan</primary>
+ </indexterm>
+ <indexterm>
+ <primary>atan2</primary>
+ </indexterm>
+ <indexterm>
+ <primary>cos</primary>
+ </indexterm>
+ <indexterm>
+ <primary>cot</primary>
+ </indexterm>
+ <indexterm>
+ <primary>sin</primary>
+ </indexterm>
+ <indexterm>
+ <primary>tan</primary>
+ </indexterm>
+
<table id="functions-math-trig-table">
<title>Trigonometric Functions</title>
function invocation. (See <xref linkend="functions-string-other">.)
</para>
+ <indexterm>
+ <primary>bit_length</primary>
+ </indexterm>
+ <indexterm>
+ <primary>char_length</primary>
+ </indexterm>
+ <indexterm>
+ <primary>convert</primary>
+ </indexterm>
+ <indexterm>
+ <primary>lower</primary>
+ </indexterm>
+ <indexterm>
+ <primary>octet_length</primary>
+ </indexterm>
+ <indexterm>
+ <primary>overlay</primary>
+ </indexterm>
+ <indexterm>
+ <primary>position</primary>
+ </indexterm>
+ <indexterm>
+ <primary>substring</primary>
+ </indexterm>
+ <indexterm>
+ <primary>trim</primary>
+ </indexterm>
+ <indexterm>
+ <primary>upper</primary>
+ </indexterm>
+
<table id="functions-string-sql">
<title><acronym>SQL</acronym> String Functions and Operators</title>
<tgroup cols="5">
<row>
<entry><literal><function>bit_length</function>(<parameter>string</parameter>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>Number of bits in string</entry>
<entry><literal>bit_length('jose')</literal></entry>
<entry><literal>32</literal></entry>
<row>
<entry><literal><function>char_length</function>(<parameter>string</parameter>)</literal> or <literal><function>character_length</function>(<parameter>string</parameter>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>
Number of characters in string
<indexterm>
<indexterm>
<primary>length</primary>
<secondary sortas="character string">of a character string</secondary>
- <see>character strings, length</see>
+ <see>character string, length</see>
</indexterm>
</entry>
<entry><literal>char_length('jose')</literal></entry>
<row>
<entry><literal><function>octet_length</function>(<parameter>string</parameter>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>Number of bytes in string</entry>
<entry><literal>octet_length('jose')</literal></entry>
<entry><literal>4</literal></entry>
</row>
<row>
- <entry><literal><function>overlay</function>(<parameter>string</parameter> placing <parameter>string</parameter> from <type>integer</type> <optional>for <type>integer</type></optional>)</literal></entry>
+ <entry><literal><function>overlay</function>(<parameter>string</parameter> placing <parameter>string</parameter> from <type>int</type> <optional>for <type>int</type></optional>)</literal></entry>
<entry><type>text</type></entry>
<entry>
Replace substring
- <indexterm>
- <primary>overlay</primary>
- </indexterm>
</entry>
<entry><literal>overlay('Txxxxas' placing 'hom' from 2 for 4)</literal></entry>
<entry><literal>Thomas</literal></entry>
<row>
<entry><literal><function>position</function>(<parameter>substring</parameter> in <parameter>string</parameter>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>Location of specified substring</entry>
<entry><literal>position('om' in 'Thomas')</literal></entry>
<entry><literal>3</literal></entry>
</row>
<row>
- <entry><literal><function>substring</function>(<parameter>string</parameter> <optional>from <type>integer</type></optional> <optional>for <type>integer</type></optional>)</literal></entry>
+ <entry><literal><function>substring</function>(<parameter>string</parameter> <optional>from <type>int</type></optional> <optional>for <type>int</type></optional>)</literal></entry>
<entry><type>text</type></entry>
<entry>
Extract substring
- <indexterm>
- <primary>substring</primary>
- </indexterm>
</entry>
<entry><literal>substring('Thomas' from 2 for 3)</literal></entry>
<entry><literal>hom</literal></entry>
<entry><type>text</type></entry>
<entry>
Extract substring matching POSIX regular expression
- <indexterm>
- <primary>substring</primary>
- </indexterm>
</entry>
<entry><literal>substring('Thomas' from '...$')</literal></entry>
<entry><literal>mas</literal></entry>
<entry>
Extract substring matching <acronym>SQL</acronym> regular
expression
- <indexterm>
- <primary>substring</primary>
- </indexterm>
</entry>
<entry><literal>substring('Thomas' from '%#"o_a#"_' for '#')</literal></entry>
<entry><literal>oma</literal></entry>
<acronym>SQL</acronym>-standard string functions listed in <xref linkend="functions-string-sql">.
</para>
+ <indexterm>
+ <primary>ascii</primary>
+ </indexterm>
+ <indexterm>
+ <primary>btrim</primary>
+ </indexterm>
+ <indexterm>
+ <primary>chr</primary>
+ </indexterm>
+ <indexterm>
+ <primary>decode</primary>
+ </indexterm>
+ <indexterm>
+ <primary>encode</primary>
+ </indexterm>
+ <indexterm>
+ <primary>initcap</primary>
+ </indexterm>
+ <indexterm>
+ <primary>lpad</primary>
+ </indexterm>
+ <indexterm>
+ <primary>ltrim</primary>
+ </indexterm>
+ <indexterm>
+ <primary>md5</primary>
+ </indexterm>
+ <indexterm>
+ <primary>pg_client_encoding</primary>
+ </indexterm>
+ <indexterm>
+ <primary>quote_ident</primary>
+ </indexterm>
+ <indexterm>
+ <primary>quote_literal</primary>
+ </indexterm>
+ <indexterm>
+ <primary>regexp_replace</primary>
+ </indexterm>
+ <indexterm>
+ <primary>repeat</primary>
+ </indexterm>
+ <indexterm>
+ <primary>replace</primary>
+ </indexterm>
+ <indexterm>
+ <primary>rpad</primary>
+ </indexterm>
+ <indexterm>
+ <primary>rtrim</primary>
+ </indexterm>
+ <indexterm>
+ <primary>split_part</primary>
+ </indexterm>
+ <indexterm>
+ <primary>strpos</primary>
+ </indexterm>
+ <indexterm>
+ <primary>substr</primary>
+ </indexterm>
+ <indexterm>
+ <primary>to_ascii</primary>
+ </indexterm>
+ <indexterm>
+ <primary>to_hex</primary>
+ </indexterm>
+ <indexterm>
+ <primary>translate</primary>
+ </indexterm>
+
<table id="functions-string-other">
<title>Other String Functions</title>
<tgroup cols="5">
<tbody>
<row>
<entry><literal><function>ascii</function>(<type>text</type>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry><acronym>ASCII</acronym> code of the first character of the argument</entry>
<entry><literal>ascii('x')</literal></entry>
<entry><literal>120</literal></entry>
</row>
<row>
- <entry><literal><function>chr</function>(<type>integer</type>)</literal></entry>
+ <entry><literal><function>chr</function>(<type>int</type>)</literal></entry>
<entry><type>text</type></entry>
<entry>Character with the given <acronym>ASCII</acronym> code</entry>
<entry><literal>chr(65)</literal></entry>
<row>
<entry><literal><function>length</function>(<parameter>string</parameter> <type>text</type>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>
Number of characters in <parameter>string</parameter>
- <indexterm>
- <primary>character string</primary>
- <secondary>length</secondary>
- </indexterm>
- <indexterm>
- <primary>length</primary>
- <secondary sortas="character string">of a character string</secondary>
- <see>character strings, length</see>
- </indexterm>
</entry>
<entry><literal>length('jose')</literal></entry>
<entry><literal>4</literal></entry>
<row>
<entry>
<literal><function>lpad</function>(<parameter>string</parameter> <type>text</type>,
- <parameter>length</parameter> <type>integer</type>
+ <parameter>length</parameter> <type>int</type>
<optional>, <parameter>fill</parameter> <type>text</type></optional>)</literal>
</entry>
<entry><type>text</type></entry>
</row>
<row>
- <entry><literal><function>quote_ident</function>(<parameter>string</parameter> text)</literal><indexterm><primary>quote_ident</></></entry>
+ <entry><literal><function>quote_ident</function>(<parameter>string</parameter> text)</literal></entry>
<entry><type>text</type></entry>
<entry>
Return the given string suitably quoted to be used as an identifier
</row>
<row>
- <entry><literal><function>quote_literal</function>(<parameter>string</parameter> text)</literal><indexterm><primary>quote_literal</></></entry>
+ <entry><literal><function>quote_literal</function>(<parameter>string</parameter> text)</literal></entry>
<entry><type>text</type></entry>
<entry>
Return the given string suitably quoted to be used as a string literal
</row>
<row>
- <entry><literal><function>repeat</function>(<parameter>string</parameter> <type>text</type>, <parameter>number</parameter> <type>integer</type>)</literal></entry>
+ <entry><literal><function>repeat</function>(<parameter>string</parameter> <type>text</type>, <parameter>number</parameter> <type>int</type>)</literal></entry>
<entry><type>text</type></entry>
<entry>Repeat <parameter>string</parameter> the specified
<parameter>number</parameter> of times</entry>
<row>
<entry>
<literal><function>rpad</function>(<parameter>string</parameter> <type>text</type>,
- <parameter>length</parameter> <type>integer</type>
+ <parameter>length</parameter> <type>int</type>
<optional>, <parameter>fill</parameter> <type>text</type></optional>)</literal>
</entry>
<entry><type>text</type></entry>
<row>
<entry><literal><function>split_part</function>(<parameter>string</parameter> <type>text</type>,
<parameter>delimiter</parameter> <type>text</type>,
- <parameter>field</parameter> <type>integer</type>)</literal></entry>
+ <parameter>field</parameter> <type>int</type>)</literal></entry>
<entry><type>text</type></entry>
<entry>Split <parameter>string</parameter> on <parameter>delimiter</parameter>
and return the given field (counting from one)
</entry>
- <entry><literal>split_part( 'abc~@~def~@~ghi', '~@~', 2)</literal></entry>
+ <entry><literal>split_part('abc~@~def~@~ghi', '~@~', 2)</literal></entry>
<entry><literal>def</literal></entry>
</row>
</row>
<row>
- <entry><literal><function>to_hex</function>(<parameter>number</parameter> <type>integer</type>
+ <entry><literal><function>to_hex</function>(<parameter>number</parameter> <type>int</type>
or <type>bigint</type>)</literal></entry>
<entry><type>text</type></entry>
<entry>Convert <parameter>number</parameter> to its equivalent hexadecimal
<row>
<entry><literal><function>octet_length</function>(<parameter>string</parameter>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>Number of bytes in binary string</entry>
<entry><literal>octet_length( 'jo\\000se'::bytea)</literal></entry>
<entry><literal>5</literal></entry>
<row>
<entry><literal><function>position</function>(<parameter>substring</parameter> in <parameter>string</parameter>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>Location of specified substring</entry>
<entry><literal>position('\\000om'::bytea in 'Th\\000omas'::bytea)</literal></entry>
<entry><literal>3</literal></entry>
</row>
<row>
- <entry><literal><function>substring</function>(<parameter>string</parameter> <optional>from <type>integer</type></optional> <optional>for <type>integer</type></optional>)</literal></entry>
+ <entry><literal><function>substring</function>(<parameter>string</parameter> <optional>from <type>int</type></optional> <optional>for <type>int</type></optional>)</literal></entry>
<entry><type>bytea</type></entry>
<entry>
Extract substring
<row>
<entry><function>get_byte</function>(<parameter>string</parameter>, <parameter>offset</parameter>)</entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>
Extract byte from string
<indexterm>
<row>
<entry><function>get_bit</function>(<parameter>string</parameter>, <parameter>offset</parameter>)</entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>
Extract bit from string
<indexterm>
<row>
<entry><literal><function>length</function>(<parameter>string</parameter>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>
Length of binary string
<indexterm>
<sect2 id="functions-like">
<title><function>LIKE</function></title>
- <indexterm zone="functions-like">
+ <indexterm>
<primary>LIKE</primary>
</indexterm>
<sect2 id="functions-similarto-regexp">
<title><function>SIMILAR TO</function> Regular Expressions</title>
- <indexterm zone="functions-similarto-regexp">
+ <indexterm>
<primary>regular expression</primary>
<!-- <seealso>pattern matching</seealso> breaks index build -->
</indexterm>
<sect1 id="functions-formatting">
<title>Data Type Formatting Functions</title>
- <indexterm zone="functions-formatting">
+ <indexterm>
<primary>formatting</primary>
</indexterm>
- <indexterm zone="functions-formatting">
+ <indexterm>
<primary>to_char</primary>
</indexterm>
+ <indexterm>
+ <primary>to_date</primary>
+ </indexterm>
+ <indexterm>
+ <primary>to_timestamp</primary>
+ </indexterm>
+ <indexterm>
+ <primary>to_number</primary>
+ </indexterm>
<para>
The <productname>PostgreSQL</productname> formatting functions
</tgroup>
</table>
+ <indexterm>
+ <primary>age</primary>
+ </indexterm>
+ <indexterm>
+ <primary>current_date</primary>
+ </indexterm>
+ <indexterm>
+ <primary>current_time</primary>
+ </indexterm>
+ <indexterm>
+ <primary>current_timestamp</primary>
+ </indexterm>
+ <indexterm>
+ <primary>date_part</primary>
+ </indexterm>
+ <indexterm>
+ <primary>date_trunc</primary>
+ </indexterm>
+ <indexterm>
+ <primary>extract</primary>
+ </indexterm>
+ <indexterm>
+ <primary>isfinite</primary>
+ </indexterm>
+ <indexterm>
+ <primary>justify_hours</primary>
+ </indexterm>
+ <indexterm>
+ <primary>justify_days</primary>
+ </indexterm>
+ <indexterm>
+ <primary>localtime</primary>
+ </indexterm>
+ <indexterm>
+ <primary>localtimestamp</primary>
+ </indexterm>
+ <indexterm>
+ <primary>now</primary>
+ </indexterm>
+ <indexterm>
+ <primary>timeofday</primary>
+ </indexterm>
+
<table id="functions-datetime-table">
<title>Date/Time Functions</title>
<tgroup cols="5">
In addition to these functions, the SQL <literal>OVERLAPS</> operator is
supported:
<synopsis>
-( <replaceable>start1</replaceable>, <replaceable>end1</replaceable> ) OVERLAPS ( <replaceable>start2</replaceable>, <replaceable>end2</replaceable> )
-( <replaceable>start1</replaceable>, <replaceable>length1</replaceable> ) OVERLAPS ( <replaceable>start2</replaceable>, <replaceable>length2</replaceable> )
+(<replaceable>start1</replaceable>, <replaceable>end1</replaceable>) OVERLAPS (<replaceable>start2</replaceable>, <replaceable>end2</replaceable>)
+(<replaceable>start1</replaceable>, <replaceable>length1</replaceable>) OVERLAPS (<replaceable>start2</replaceable>, <replaceable>length2</replaceable>)
</synopsis>
This expression yields true when two time periods (defined by their
endpoints) overlap, false when they do not overlap. The endpoints
<sect2 id="functions-datetime-extract">
<title><function>EXTRACT</function>, <function>date_part</function></title>
+ <indexterm>
+ <primary>date_part</primary>
+ </indexterm>
+ <indexterm>
+ <primary>extract</primary>
+ </indexterm>
+
<synopsis>
-EXTRACT (<replaceable>field</replaceable> FROM <replaceable>source</replaceable>)
+EXTRACT(<replaceable>field</replaceable> FROM <replaceable>source</replaceable>)
</synopsis>
<para>
</varlistentry>
</variablelist>
-
</para>
<para>
<sect2 id="functions-datetime-trunc">
<title><function>date_trunc</function></title>
+ <indexterm>
+ <primary>date_trunc</primary>
+ </indexterm>
+
<para>
The function <function>date_trunc</function> is conceptually
similar to the <function>trunc</function> function for numbers.
<secondary>conversion</secondary>
</indexterm>
+ <indexterm>
+ <primary>AT TIME ZONE</primary>
+ </indexterm>
+
<para>
The <literal>AT TIME ZONE</literal> construct allows conversions
of time stamps to different time zones. <xref
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
-CURRENT_TIME ( <replaceable>precision</replaceable> )
-CURRENT_TIMESTAMP ( <replaceable>precision</replaceable> )
+CURRENT_TIME (<replaceable>precision</replaceable>)
+CURRENT_TIMESTAMP (<replaceable>precision</replaceable>)
LOCALTIME
LOCALTIMESTAMP
-LOCALTIME ( <replaceable>precision</replaceable> )
-LOCALTIMESTAMP ( <replaceable>precision</replaceable> )
+LOCALTIME (<replaceable>precision</replaceable>)
+LOCALTIMESTAMP (<replaceable>precision</replaceable>)
</synopsis>
</para>
</tgroup>
</table>
+ <indexterm>
+ <primary>area</primary>
+ </indexterm>
+ <indexterm>
+ <primary>center</primary>
+ </indexterm>
+ <indexterm>
+ <primary>diameter</primary>
+ </indexterm>
+ <indexterm>
+ <primary>height</primary>
+ </indexterm>
+ <indexterm>
+ <primary>isclosed</primary>
+ </indexterm>
+ <indexterm>
+ <primary>isopen</primary>
+ </indexterm>
+ <indexterm>
+ <primary>length</primary>
+ </indexterm>
+ <indexterm>
+ <primary>npoints</primary>
+ </indexterm>
+ <indexterm>
+ <primary>pclose</primary>
+ </indexterm>
+ <indexterm>
+ <primary>popen</primary>
+ </indexterm>
+ <indexterm>
+ <primary>radius</primary>
+ </indexterm>
+ <indexterm>
+ <primary>width</primary>
+ </indexterm>
<table id="functions-geometry-func-table">
<title>Geometric Functions</title>
</row>
<row>
<entry><literal><function>npoints</function>(<type>path</>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>number of points</entry>
<entry><literal>npoints(path '[(0,0),(1,1),(2,0)]')</literal></entry>
</row>
<row>
<entry><literal><function>npoints</function>(<type>polygon</>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>number of points</entry>
<entry><literal>npoints(polygon '((1,1),(0,0))')</literal></entry>
</row>
</tgroup>
</table>
-
<table id="functions-geometry-conv-table">
<title>Geometric Type Conversion Functions</title>
<tgroup cols="4">
</row>
<row>
<entry><literal><function>masklen</function>(<type>inet</type>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>extract netmask length</entry>
<entry><literal>masklen('192.168.1.5/24')</literal></entry>
<entry><literal>24</literal></entry>
</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>int</type>)</literal></entry>
<entry><type>inet</type></entry>
<entry>set netmask length for <type>inet</type> value</entry>
<entry><literal>set_masklen('192.168.1.5/24', 16)</literal></entry>
</row>
<row>
<entry><literal><function>family</function>(<type>inet</type>)</literal></entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>extract family of address; <literal>4</literal> for IPv4,
<literal>6</literal> for IPv6</entry>
<entry><literal>family('::1')</literal></entry>
the SQL standard, but are a common extension.
</para>
</sect2>
-
</sect1>
<entry>
<literal>
<function>array_lower</function>
- (<type>anyarray</type>, <type>integer</type>)
+ (<type>anyarray</type>, <type>int</type>)
</literal>
</entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></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>0</literal></entry>
<entry>
<literal>
<function>array_upper</function>
- (<type>anyarray</type>, <type>integer</type>)
+ (<type>anyarray</type>, <type>int</type>)
</literal>
</entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></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>4</literal></entry>
<function>avg(<replaceable class="parameter">expression</replaceable>)</function>
</entry>
<entry>
- <type>smallint</type>, <type>integer</type>,
+ <type>smallint</type>, <type>int</type>,
<type>bigint</type>, <type>real</type>, <type>double
precision</type>, <type>numeric</type>, or <type>interval</type>
</entry>
<function>bit_and(<replaceable class="parameter">expression</replaceable>)</function>
</entry>
<entry>
- <type>smallint</type>, <type>integer</type>, <type>bigint</type>, or
+ <type>smallint</type>, <type>int</type>, <type>bigint</type>, or
<type>bit</type>
</entry>
<entry>
<function>bit_or(<replaceable class="parameter">expression</replaceable>)</function>
</entry>
<entry>
- <type>smallint</type>, <type>integer</type>, <type>bigint</type>, or
+ <type>smallint</type>, <type>int</type>, <type>bigint</type>, or
<type>bit</type>
</entry>
<entry>
<function>stddev(<replaceable class="parameter">expression</replaceable>)</function>
</entry>
<entry>
- <type>smallint</type>, <type>integer</type>,
+ <type>smallint</type>, <type>int</type>,
<type>bigint</type>, <type>real</type>, <type>double
precision</type>, or <type>numeric</type>
</entry>
<row>
<entry><function>sum(<replaceable class="parameter">expression</replaceable>)</function></entry>
<entry>
- <type>smallint</type>, <type>integer</type>,
+ <type>smallint</type>, <type>int</type>,
<type>bigint</type>, <type>real</type>, <type>double
precision</type>, <type>numeric</type>, or
<type>interval</type>
</entry>
<entry>
<type>bigint</type> for <type>smallint</type> or
- <type>integer</type> arguments, <type>numeric</type> for
+ <type>int</type> arguments, <type>numeric</type> for
<type>bigint</type> arguments, <type>double precision</type>
for floating-point arguments, otherwise the same as the
argument data type
<function>variance</function>(<replaceable class="parameter">expression</replaceable>)
</entry>
<entry>
- <type>smallint</type>, <type>integer</type>,
+ <type>smallint</type>, <type>int</type>,
<type>bigint</type>, <type>real</type>, <type>double
precision</type>, or <type>numeric</type>
</entry>
<title><literal>EXISTS</literal></title>
<synopsis>
-EXISTS ( <replaceable>subquery</replaceable> )
+EXISTS (<replaceable>subquery</replaceable>)
</synopsis>
<para>
otherwise the result of the row comparison is unknown (null).
</para>
+ <indexterm>
+ <primary>IS DISTINCT FROM</primary>
+ </indexterm>
+
<synopsis>
<replaceable>row_constructor</replaceable> IS DISTINCT FROM <replaceable>row_constructor</replaceable>
</synopsis>
<secondary>functions</secondary>
</indexterm>
+ <indexterm>
+ <primary>generate_series</primary>
+ </indexterm>
+
<para>
This section describes functions that possibly return more than one row.
Currently the only functions in this class are series generating functions,
<row>
<entry><literal><function>inet_client_port</function>()</literal></entry>
- <entry><type>int4</type></entry>
+ <entry><type>int</type></entry>
<entry>port of the remote connection</entry>
</row>
<row>
<entry><literal><function>inet_server_port</function>()</literal></entry>
- <entry><type>int4</type></entry>
+ <entry><type>int</type></entry>
<entry>port of the local connection</entry>
</row>
</indexterm>
<para>
- <function>pg_postmaster_start_time</function> returns the timestamp with time zone
- when the <command>postmaster</> started.
+ <function>pg_postmaster_start_time</function> returns the
+ <type>timestamp with time zone</type> when the
+ <command>postmaster</> started.
</para>
<indexterm zone="functions-info">
<row>
<entry><literal><function>pg_tablespace_databases</function>(<parameter>tablespace_oid</parameter>)</literal></entry>
<entry><type>setof oid</type></entry>
- <entry>get set of database OIDs that have objects in the tablespace</entry>
+ <entry>get the set of database OIDs that have objects in the tablespace</entry>
</row>
</tbody>
</tgroup>
</para>
<para>
- <function>pg_get_userbyid</function>
- extracts a role's name given its OID.
- <function>pg_get_serial_sequence</function>
- fetches the name of the sequence associated with a serial or
- bigserial column. The name is suitably formatted
- for passing to the sequence functions (see <xref
- linkend="functions-sequence">).
- NULL is returned if the column does not have a sequence attached.
+ <function>pg_get_userbyid</function> extracts a role's name given
+ its OID.
</para>
<para>
- <function>pg_tablespace_databases</function> allows usage examination of a
- tablespace. It will return a set of OIDs of databases that have objects
- stored in the tablespace. If this function returns any row, the
+ <function>pg_get_serial_sequence</function> fetches the name of the
+ sequence associated with a <type>serial</> or <type>bigserial</>
+ column. The name is suitably formatted for passing to the sequence
+ functions (see <xref linkend="functions-sequence">). NULL is
+ returned if the column does not have an associated sequence.
+ </para>
+
+ <para>
+ <function>pg_tablespace_databases</function> allows a tablespace to
+ be examined. It returns the set of OIDs of databases that have objects
+ stored in the tablespace. If this function returns any rows, the
tablespace is not empty and cannot be dropped. To
display the specific objects populating the tablespace, you will need
to connect to the databases identified by
</para>
<para>
- <function>pg_cancel_backend</> sends a Query Cancel (SIGINT) signal
- to a backend process identified by process ID (<literal>pid</literal>).
- The process ID of an active backend can be found from the
- <structfield>procpid</structfield> column in the
+ <function>pg_cancel_backend</> sends a query cancel
+ (<systemitem>SIGINT</>) signal to a backend process identified by
+ process ID. The process ID of an active backend can be found from
+ the <structfield>procpid</structfield> column in the
<structname>pg_stat_activity</structname> view, or by listing the
<command>postgres</command> processes on the server with
<application>ps</>.
</para>
<para>
- <function>pg_reload_conf</> sends a SIGHUP signal to the
- postmaster, causing reload of the configuration files
- in all server processes.
+ <function>pg_reload_conf</> sends a <systemitem>SIGHUP</> signal
+ to the <application>postmaster</>, causing the configuration files
+ to be reloaded by all server processes.
</para>
<para>
<tbody>
<row>
<entry><function>pg_column_size</function>(<type>any</type>)</entry>
- <entry><type>integer</type></entry>
+ <entry><type>int</type></entry>
<entry>Number of bytes used to store a particular value (possibly compressed)</entry>
</row>
<row>
</row>
<row>
<entry>
- <literal><function>pg_read_file</function>(<parameter>filename</> <type>text</>, <parameter>offset</> <type>int8</>, <parameter>length</> <type>int8</>)</literal>
+ <literal><function>pg_read_file</function>(<parameter>filename</> <type>text</>, <parameter>offset</> <type>bigint</>, <parameter>length</> <type>bigint</>)</literal>
</entry>
<entry><type>text</type></entry>
<entry>Return the contents of a text file</entry>