Commit b2fd8ebe authored by Tom Lane's avatar Tom Lane

Doc: update remaining tables of functions/operators for new layout.

This converts the contrib documentation to the new style, and mops up
a couple of function tables that were outside chapter 9 in the main
docs.

A few contrib modules choose not to present their functions in the
standard tabular format.  There might be room to rethink those decisions
now that the standard format is more friendly to verbose descriptions.
But I have not undertaken to do that here; I just converted existing
tables.
parent c265ed9b
...@@ -29,49 +29,69 @@ ...@@ -29,49 +29,69 @@
<table id="functions-adminpack-table"> <table id="functions-adminpack-table">
<title><filename>adminpack</filename> Functions</title> <title><filename>adminpack</filename> Functions</title>
<tgroup cols="3"> <tgroup cols="1">
<thead> <thead>
<row><entry>Name</entry> <entry>Return Type</entry> <entry>Description</entry> <row>
</row> <entry role="func_table_entry"><para role="func_signature">
</thead> Function
</para>
<tbody> <para>
<row> Description
<entry><function>pg_catalog.pg_file_write(filename text, data text, append boolean)</function></entry> </para></entry>
<entry><type>bigint</type></entry> </row>
<entry> </thead>
Write, or append to, a text file
</entry> <tbody>
</row> <row>
<row> <entry role="func_table_entry"><para role="func_signature">
<entry><function>pg_catalog.pg_file_sync(filename text)</function></entry> <function>pg_catalog.pg_file_write</function> ( <parameter>filename</parameter> <type>text</type>, <parameter>data</parameter> <type>text</type>, <parameter>append</parameter> <type>boolean</type> )
<entry><type>void</type></entry> <returnvalue>bigint</returnvalue>
<entry> </para>
Flush a file or directory to disk <para>
</entry> Writes, or appends to, a text file.
</row> </para></entry>
<row> </row>
<entry><function>pg_catalog.pg_file_rename(oldname text, newname text <optional>, archivename text</optional>)</function></entry>
<entry><type>boolean</type></entry> <row>
<entry> <entry role="func_table_entry"><para role="func_signature">
Rename a file <function>pg_catalog.pg_file_sync</function> ( <parameter>filename</parameter> <type>text</type> )
</entry> <returnvalue>void</returnvalue>
</row> </para>
<row> <para>
<entry><function>pg_catalog.pg_file_unlink(filename text)</function></entry> Flushes a file or directory to disk.
<entry><type>boolean</type></entry> </para></entry>
<entry> </row>
Remove a file
</entry> <row>
</row> <entry role="func_table_entry"><para role="func_signature">
<row> <function>pg_catalog.pg_file_rename</function> ( <parameter>oldname</parameter> <type>text</type>, <parameter>newname</parameter> <type>text</type> <optional>, <parameter>archivename</parameter> <type>text</type> </optional> )
<entry><function>pg_catalog.pg_logdir_ls()</function></entry> <returnvalue>boolean</returnvalue>
<entry><type>setof record</type></entry> </para>
<entry> <para>
List the log files in the <varname>log_directory</varname> directory Renames a file.
</entry> </para></entry>
</row> </row>
</tbody>
<row>
<entry role="func_table_entry"><para role="func_signature">
<function>pg_catalog.pg_file_unlink</function> ( <parameter>filename</parameter> <type>text</type> )
<returnvalue>boolean</returnvalue>
</para>
<para>
Removes a file.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<function>pg_catalog.pg_logdir_ls</function> ()
<returnvalue>setof record</returnvalue>
</para>
<para>
Lists the log files in the <varname>log_directory</varname> directory.
</para></entry>
</row>
</tbody>
</tgroup> </tgroup>
</table> </table>
......
This diff is collapsed.
...@@ -67,76 +67,120 @@ ...@@ -67,76 +67,120 @@
<table id="earthdistance-cube-functions"> <table id="earthdistance-cube-functions">
<title>Cube-Based Earthdistance Functions</title> <title>Cube-Based Earthdistance Functions</title>
<tgroup cols="3"> <tgroup cols="1">
<thead> <thead>
<row> <row>
<entry>Function</entry> <entry role="func_table_entry"><para role="func_signature">
<entry>Returns</entry> Function
<entry>Description</entry> </para>
</row> <para>
</thead> Description
<tbody> </para></entry>
<row> </row>
<entry><function>earth()</function><indexterm><primary>earth</primary></indexterm></entry> </thead>
<entry><type>float8</type></entry>
<entry>Returns the assumed radius of the Earth.</entry> <tbody>
</row> <row>
<row> <entry role="func_table_entry"><para role="func_signature">
<entry><function>sec_to_gc(float8)</function><indexterm><primary>sec_to_gc</primary></indexterm></entry> <indexterm><primary>earth</primary></indexterm>
<entry><type>float8</type></entry> <function>earth</function> ()
<entry>Converts the normal straight line <returnvalue>float8</returnvalue>
(secant) distance between two points on the surface of the Earth </para>
to the great circle distance between them. <para>
</entry> Returns the assumed radius of the Earth.
</row> </para></entry>
<row> </row>
<entry><function>gc_to_sec(float8)</function><indexterm><primary>gc_to_sec</primary></indexterm></entry>
<entry><type>float8</type></entry> <row>
<entry>Converts the great circle distance between two points on the <entry role="func_table_entry"><para role="func_signature">
surface of the Earth to the normal straight line (secant) distance <indexterm><primary>sec_to_gc</primary></indexterm>
between them. <function>sec_to_gc</function> ( <type>float8</type> )
</entry> <returnvalue>float8</returnvalue>
</row> </para>
<row> <para>
<entry><function>ll_to_earth(float8, float8)</function><indexterm><primary>ll_to_earth</primary></indexterm></entry> Converts the normal straight line
<entry><type>earth</type></entry> (secant) distance between two points on the surface of the Earth
<entry>Returns the location of a point on the surface of the Earth given to the great circle distance between them.
its latitude (argument 1) and longitude (argument 2) in degrees. </para></entry>
</entry> </row>
</row>
<row> <row>
<entry><function>latitude(earth)</function><indexterm><primary>latitude</primary></indexterm></entry> <entry role="func_table_entry"><para role="func_signature">
<entry><type>float8</type></entry> <indexterm><primary>gc_to_sec</primary></indexterm>
<entry>Returns the latitude in degrees of a point on the surface of the <function>gc_to_sec</function> ( <type>float8</type> )
Earth. <returnvalue>float8</returnvalue>
</entry> </para>
</row> <para>
<row> Converts the great circle distance between two points on the
<entry><function>longitude(earth)</function><indexterm><primary>longitude</primary></indexterm></entry> surface of the Earth to the normal straight line (secant) distance
<entry><type>float8</type></entry> between them.
<entry>Returns the longitude in degrees of a point on the surface of the </para></entry>
Earth. </row>
</entry>
</row> <row>
<row> <entry role="func_table_entry"><para role="func_signature">
<entry><function>earth_distance(earth, earth)</function><indexterm><primary>earth_distance</primary></indexterm></entry> <indexterm><primary>ll_to_earth</primary></indexterm>
<entry><type>float8</type></entry> <function>ll_to_earth</function> ( <type>float8</type>, <type>float8</type> )
<entry>Returns the great circle distance between two points on the <returnvalue>earth</returnvalue>
surface of the Earth. </para>
</entry> <para>
</row> Returns the location of a point on the surface of the Earth given
<row> its latitude (argument 1) and longitude (argument 2) in degrees.
<entry><function>earth_box(earth, float8)</function><indexterm><primary>earth_box</primary></indexterm></entry> </para></entry>
<entry><type>cube</type></entry> </row>
<entry>Returns a box suitable for an indexed search using the cube
<literal>@&gt;</literal> <row>
operator for points within a given great circle distance of a location. <entry role="func_table_entry"><para role="func_signature">
Some points in this box are further than the specified great circle <indexterm><primary>latitude</primary></indexterm>
distance from the location, so a second check using <function>latitude</function> ( <type>earth</type> )
<function>earth_distance</function> should be included in the query. <returnvalue>float8</returnvalue>
</entry> </para>
</row> <para>
</tbody> Returns the latitude in degrees of a point on the surface of the
Earth.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm><primary>longitude</primary></indexterm>
<function>longitude</function> ( <type>earth</type> )
<returnvalue>float8</returnvalue>
</para>
<para>
Returns the longitude in degrees of a point on the surface of the
Earth.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm><primary>earth_distance</primary></indexterm>
<function>earth_distance</function> ( <type>earth</type>, <type>earth</type> )
<returnvalue>float8</returnvalue>
</para>
<para>
Returns the great circle distance between two points on the
surface of the Earth.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm><primary>earth_box</primary></indexterm>
<function>earth_box</function> ( <type>earth</type>, <type>float8</type> )
<returnvalue>cube</returnvalue>
</para>
<para>
Returns a box suitable for an indexed search using the <type>cube</type>
<literal>@&gt;</literal>
operator for points within a given great circle distance of a location.
Some points in this box are further than the specified great circle
distance from the location, so a second check using
<function>earth_distance</function> should be included in the query.
</para></entry>
</row>
</tbody>
</tgroup> </tgroup>
</table> </table>
...@@ -161,23 +205,29 @@ ...@@ -161,23 +205,29 @@
<table id="earthdistance-point-operators"> <table id="earthdistance-point-operators">
<title>Point-Based Earthdistance Operators</title> <title>Point-Based Earthdistance Operators</title>
<tgroup cols="3"> <tgroup cols="1">
<thead> <thead>
<row> <row>
<entry>Operator</entry> <entry role="func_table_entry"><para role="func_signature">
<entry>Returns</entry> Operator
<entry>Description</entry> </para>
</row> <para>
</thead> Description
<tbody> </para></entry>
<row> </row>
<entry><type>point</type> <literal>&lt;@&gt;</literal> <type>point</type></entry> </thead>
<entry><type>float8</type></entry> <tbody>
<entry>Gives the distance in statute miles between <row>
two points on the Earth's surface. <entry role="func_table_entry"><para role="func_signature">
</entry> <type>point</type> <literal>&lt;@&gt;</literal> <type>point</type>
</row> <returnvalue>float8</returnvalue>
</tbody> </para>
<para>
Computes the distance in statute miles between
two points on the Earth's surface.
</para></entry>
</row>
</tbody>
</tgroup> </tgroup>
</table> </table>
......
This diff is collapsed.
This diff is collapsed.
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
<table id="isn-datatypes"> <table id="isn-datatypes">
<title><filename>isn</filename> Data Types</title> <title><filename>isn</filename> Data Types</title>
<tgroup cols="2"> <tgroup cols="2">
<colspec colname="col1" colwidth="1*"/>
<colspec colname="col2" colwidth="2*"/>
<thead> <thead>
<row> <row>
<entry>Data Type</entry> <entry>Data Type</entry>
...@@ -235,38 +237,63 @@ ...@@ -235,38 +237,63 @@
<table id="isn-functions"> <table id="isn-functions">
<title><filename>isn</filename> Functions</title> <title><filename>isn</filename> Functions</title>
<tgroup cols="3"> <tgroup cols="1">
<thead> <thead>
<row> <row>
<entry>Function</entry> <entry role="func_table_entry"><para role="func_signature">
<entry>Returns</entry> Function
<entry>Description</entry> </para>
</row> <para>
</thead> Description
</para></entry>
<tbody> </row>
<row> </thead>
<entry><function>isn_weak(boolean)</function><indexterm><primary>isn_weak</primary></indexterm></entry>
<entry><type>boolean</type></entry> <tbody>
<entry>Sets the weak input mode (returns new setting)</entry> <row>
</row> <entry role="func_table_entry"><para role="func_signature">
<row> <indexterm><primary>isn_weak</primary></indexterm>
<entry><function>isn_weak()</function></entry> <function>isn_weak</function> ( <type>boolean</type> )
<entry><type>boolean</type></entry> <returnvalue>boolean</returnvalue>
<entry>Gets the current status of the weak mode</entry> </para>
</row> <para>
<row> Sets the weak input mode, and returns new setting.
<entry><function>make_valid(isn)</function><indexterm><primary>make_valid</primary></indexterm></entry> </para></entry>
<entry><type>isn</type></entry> </row>
<entry>Validates an invalid number (clears the invalid flag)</entry>
</row> <row>
<row> <entry role="func_table_entry"><para role="func_signature">
<entry><function>is_valid(isn)</function><indexterm><primary>is_valid</primary></indexterm></entry> <function>isn_weak</function> ()
<entry><type>boolean</type></entry> <returnvalue>boolean</returnvalue>
<entry>Checks for the presence of the invalid flag</entry> </para>
</row> <para>
</tbody> Returns the current status of the weak mode.
</tgroup> </para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm><primary>make_valid</primary></indexterm>
<function>make_valid</function> ( <type>isn</type> )
<returnvalue>isn</returnvalue>
</para>
<para>
Validates an invalid number (clears the invalid flag).
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm><primary>is_valid</primary></indexterm>
<function>is_valid</function> ( <type>isn</type> )
<returnvalue>boolean</returnvalue>
</para>
<para>
Checks for the presence of the invalid flag.
</para></entry>
</row>
</tbody>
</tgroup>
</table> </table>
<para> <para>
......
...@@ -542,69 +542,82 @@ int lo_unlink(PGconn *conn, Oid lobjId); ...@@ -542,69 +542,82 @@ int lo_unlink(PGconn *conn, Oid lobjId);
listed in <xref linkend="lo-funcs-table"/>. listed in <xref linkend="lo-funcs-table"/>.
</para> </para>
<table id="lo-funcs-table"> <table id="lo-funcs-table">
<title>SQL-Oriented Large Object Functions</title> <title>SQL-Oriented Large Object Functions</title>
<tgroup cols="5"> <tgroup cols="1">
<thead> <thead>
<row> <row>
<entry>Function</entry> <entry role="func_table_entry"><para role="func_signature">
<entry>Return Type</entry> Function
<entry>Description</entry> </para>
<entry>Example</entry> <para>
<entry>Result</entry> Description
</row> </para>
</thead> <para>
Example(s)
<tbody> </para></entry>
<row> </row>
<entry> </thead>
<indexterm>
<primary>lo_from_bytea</primary> <tbody>
</indexterm> <row>
<literal><function>lo_from_bytea(<parameter>loid</parameter> <type>oid</type>, <parameter>string</parameter> <type>bytea</type>)</function></literal> <entry role="func_table_entry"><para role="func_signature">
</entry> <indexterm>
<entry><type>oid</type></entry> <primary>lo_from_bytea</primary>
<entry> </indexterm>
Create a large object and store data there, returning its OID. <function>lo_from_bytea</function> ( <parameter>loid</parameter> <type>oid</type>, <parameter>data</parameter> <type>bytea</type> )
Pass <literal>0</literal> to have the system choose an OID. <returnvalue>oid</returnvalue>
</entry> </para>
<entry><literal>lo_from_bytea(0, '\xffffff00')</literal></entry> <para>
<entry><literal>24528</literal></entry> Creates a large object and stores <parameter>data</parameter> in it.
</row> If <parameter>loid</parameter> is zero then the system will choose a
free OID, otherwise that OID is used (with an error if some large
<row> object already has that OID). On success, the large object's OID is
<entry> returned.
<indexterm> </para>
<primary>lo_put</primary> <para>
</indexterm> <literal>lo_from_bytea(0, '\xffffff00')</literal>
<literal><function>lo_put(<parameter>loid</parameter> <type>oid</type>, <parameter>offset</parameter> <type>bigint</type>, <parameter>str</parameter> <type>bytea</type>)</function></literal> <returnvalue>24528</returnvalue>
</entry> </para></entry>
<entry><type>void</type></entry> </row>
<entry>
Write data at the given offset. <row>
</entry> <entry role="func_table_entry"><para role="func_signature">
<entry><literal>lo_put(24528, 1, '\xaa')</literal></entry> <indexterm>
<entry></entry> <primary>lo_put</primary>
</row> </indexterm>
<function>lo_put</function> ( <parameter>loid</parameter> <type>oid</type>, <parameter>offset</parameter> <type>bigint</type>, <parameter>data</parameter> <type>bytea</type> )
<row> <returnvalue>void</returnvalue>
<entry> </para>
<indexterm> <para>
<primary>lo_get</primary> Writes <parameter>data</parameter> starting at the given offset within
</indexterm> the large object; the large object is enlarged if necessary.
<literal><function>lo_get(<parameter>loid</parameter> <type>oid</type> <optional>, <parameter>from</parameter> <type>bigint</type>, <parameter>for</parameter> <type>int</type></optional>)</function></literal> </para>
</entry> <para>
<entry><type>bytea</type></entry> <literal>lo_put(24528, 1, '\xaa')</literal>
<entry> <returnvalue></returnvalue>
Extract contents or a substring thereof. </para></entry>
</entry> </row>
<entry><literal>lo_get(24528, 0, 3)</literal></entry>
<entry><literal>\xffaaff</literal></entry> <row>
</row> <entry role="func_table_entry"><para role="func_signature">
<indexterm>
</tbody> <primary>lo_get</primary>
</tgroup> </indexterm>
</table> <function>lo_get</function> ( <parameter>loid</parameter> <type>oid</type> <optional>, <parameter>offset</parameter> <type>bigint</type>, <parameter>length</parameter> <type>integer</type> </optional> )
<returnvalue>bytea</returnvalue>
</para>
<para>
Extracts the large object's contents, or a substring thereof.
</para>
<para>
<literal>lo_get(24528, 0, 3)</literal>
<returnvalue>\xffaaff</returnvalue>
</para></entry>
</row>
</tbody>
</tgroup>
</table>
<para> <para>
There are additional server-side functions corresponding to each of the There are additional server-side functions corresponding to each of the
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -141,6 +141,8 @@ test=&gt; select '6.25 .. 6.50'::seg as "pH"; ...@@ -141,6 +141,8 @@ test=&gt; select '6.25 .. 6.50'::seg as "pH";
<table id="seg-input-examples"> <table id="seg-input-examples">
<title>Examples of Valid <type>seg</type> Input</title> <title>Examples of Valid <type>seg</type> Input</title>
<tgroup cols="2"> <tgroup cols="2">
<colspec colname="col1" colwidth="1*"/>
<colspec colname="col2" colwidth="2*"/>
<tbody> <tbody>
<row> <row>
<entry><literal>5.0</literal></entry> <entry><literal>5.0</literal></entry>
...@@ -248,65 +250,106 @@ test=&gt; select '6.25 .. 6.50'::seg as "pH"; ...@@ -248,65 +250,106 @@ test=&gt; select '6.25 .. 6.50'::seg as "pH";
<table id="seg-gist-operators"> <table id="seg-gist-operators">
<title>Seg GiST Operators</title> <title>Seg GiST Operators</title>
<tgroup cols="2"> <tgroup cols="1">
<thead> <thead>
<row> <row>
<entry>Operator</entry> <entry role="func_table_entry"><para role="func_signature">
<entry>Description</entry> Operator
</row> </para>
</thead> <para>
Description
</para></entry>
</row>
</thead>
<tbody> <tbody>
<row> <row>
<entry><literal>[a, b] &lt;&lt; [c, d]</literal></entry> <entry role="func_table_entry"><para role="func_signature">
<entry>[a, b] is entirely to the left of [c, d]. That is, [a, <type>seg</type> <literal>&lt;&lt;</literal> <type>seg</type>
b] &lt;&lt; [c, d] is true if b &lt; c and false otherwise.</entry> <returnvalue>boolean</returnvalue>
</row> </para>
<para>
Is the first <type>seg</type> entirely to the left of the second?
[a, b] &lt;&lt; [c, d] is true if b &lt; c.
</para></entry>
</row>
<row> <row>
<entry><literal>[a, b] &gt;&gt; [c, d]</literal></entry> <entry role="func_table_entry"><para role="func_signature">
<entry>[a, b] is entirely to the right of [c, d]. That is, [a, <type>seg</type> <literal>&gt;&gt;</literal> <type>seg</type>
b] &gt;&gt; [c, d] is true if a &gt; d and false otherwise.</entry> <returnvalue>boolean</returnvalue>
</row> </para>
<para>
Is the first <type>seg</type> entirely to the right of the second?
[a, b] &gt;&gt; [c, d] is true if a &gt; d.
</para></entry>
</row>
<row> <row>
<entry><literal>[a, b] &amp;&lt; [c, d]</literal></entry> <entry role="func_table_entry"><para role="func_signature">
<entry>Overlaps or is left of &mdash; This might be better read <type>seg</type> <literal>&amp;&lt;</literal> <type>seg</type>
as <quote>does not extend to right of</quote>. It is true when <returnvalue>boolean</returnvalue>
b &lt;= d.</entry> </para>
</row> <para>
Does the first <type>seg</type> not extend to the right of the
second?
[a, b] &amp;&lt; [c, d] is true if b &lt;= d.
</para></entry>
</row>
<row> <row>
<entry><literal>[a, b] &amp;&gt; [c, d]</literal></entry> <entry role="func_table_entry"><para role="func_signature">
<entry>Overlaps or is right of &mdash; This might be better read <type>seg</type> <literal>&amp;&gt;</literal> <type>seg</type>
as <quote>does not extend to left of</quote>. It is true when <returnvalue>boolean</returnvalue>
a &gt;= c.</entry> </para>
</row> <para>
Does the first <type>seg</type> not extend to the left of the
second?
[a, b] &amp;&gt; [c, d] is true if a &gt;= c.
</para></entry>
</row>
<row> <row>
<entry><literal>[a, b] = [c, d]</literal></entry> <entry role="func_table_entry"><para role="func_signature">
<entry>Same as &mdash; The segments [a, b] and [c, d] are <type>seg</type> <literal>=</literal> <type>seg</type>
identical, that is, a = c and b = d.</entry> <returnvalue>boolean</returnvalue>
</row> </para>
<para>
Are the two <type>seg</type>s equal?
</para></entry>
</row>
<row> <row>
<entry><literal>[a, b] &amp;&amp; [c, d]</literal></entry> <entry role="func_table_entry"><para role="func_signature">
<entry>The segments [a, b] and [c, d] overlap.</entry> <type>seg</type> <literal>&amp;&amp;</literal> <type>seg</type>
</row> <returnvalue>boolean</returnvalue>
</para>
<para>
Do the two <type>seg</type>s overlap?
</para></entry>
</row>
<row> <row>
<entry><literal>[a, b] @&gt; [c, d]</literal></entry> <entry role="func_table_entry"><para role="func_signature">
<entry>The segment [a, b] contains the segment [c, d], that is, <type>seg</type> <literal>@&gt;</literal> <type>seg</type>
a &lt;= c and b &gt;= d.</entry> <returnvalue>boolean</returnvalue>
</row> </para>
<para>
Does the first <type>seg</type> contain the second?
</para></entry>
</row>
<row> <row>
<entry><literal>[a, b] &lt;@ [c, d]</literal></entry> <entry role="func_table_entry"><para role="func_signature">
<entry>The segment [a, b] is contained in [c, d], that is, a <type>seg</type> <literal>&lt;@</literal> <type>seg</type>
&gt;= c and b &lt;= d.</entry> <returnvalue>boolean</returnvalue>
</row> </para>
</tbody> <para>
</tgroup> Is the first <type>seg</type> contained in the second?
</para></entry>
</row>
</tbody>
</tgroup>
</table> </table>
<para> <para>
...@@ -318,33 +361,10 @@ test=&gt; select '6.25 .. 6.50'::seg as "pH"; ...@@ -318,33 +361,10 @@ test=&gt; select '6.25 .. 6.50'::seg as "pH";
</para> </para>
<para> <para>
The standard B-tree operators are also provided, for example In addition to the above operators, the usual comparison
operators shown in <xref linkend="functions-comparison-op-table"/> are
<informaltable> available for type <type>seg</type>. These operators
<tgroup cols="2"> first compare (a) to (c),
<thead>
<row>
<entry>Operator</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>[a, b] &lt; [c, d]</literal></entry>
<entry>Less than</entry>
</row>
<row>
<entry><literal>[a, b] &gt; [c, d]</literal></entry>
<entry>Greater than</entry>
</row>
</tbody>
</tgroup>
</informaltable>
These operators do not make a lot of sense for any practical
purpose but sorting. These operators first compare (a) to (c),
and if these are equal, compare (b) to (d). That results in and if these are equal, compare (b) to (d). That results in
reasonably good sorting in most cases, which is useful if reasonably good sorting in most cases, which is useful if
you want to use ORDER BY with this type. you want to use ORDER BY with this type.
......
...@@ -605,7 +605,7 @@ regression=# select sepgsql_getcon(); ...@@ -605,7 +605,7 @@ regression=# select sepgsql_getcon();
(1 row) (1 row)
regression=# SELECT sepgsql_setcon('unconfined_u:unconfined_r:unconfined_t:s0-s0:c1.c4'); regression=# SELECT sepgsql_setcon('unconfined_u:unconfined_r:unconfined_t:s0-s0:c1.c4');
sepgsql_setcon sepgsql_setcon
---------------- ----------------
t t
(1 row) (1 row)
...@@ -659,45 +659,77 @@ ERROR: SELinux: security policy violation ...@@ -659,45 +659,77 @@ ERROR: SELinux: security policy violation
<table id="sepgsql-functions-table"> <table id="sepgsql-functions-table">
<title>Sepgsql Functions</title> <title>Sepgsql Functions</title>
<tgroup cols="2"> <tgroup cols="1">
<tbody> <thead>
<row> <row>
<entry><literal>sepgsql_getcon() returns text</literal></entry> <entry role="func_table_entry"><para role="func_signature">
<entry> Function
Returns the client domain, the current security label of the client. </para>
</entry> <para>
</row> Description
<row> </para></entry>
<entry><literal>sepgsql_setcon(text) returns bool</literal></entry> </row>
<entry> </thead>
Switches the client domain of the current session to the new domain,
if allowed by the security policy. <tbody>
It also accepts <literal>NULL</literal> input as a request to transition <row>
to the client's original domain. <entry role="func_table_entry"><para role="func_signature">
</entry> <function>sepgsql_getcon</function> ()
</row> <returnvalue>text</returnvalue>
<row> </para>
<entry><literal>sepgsql_mcstrans_in(text) returns text</literal></entry> <para>
<entry>Translates the given qualified MLS/MCS range into raw format if Returns the client domain, the current security label of the client.
the mcstrans daemon is running. </para></entry>
</entry> </row>
</row>
<row> <row>
<entry><literal>sepgsql_mcstrans_out(text) returns text</literal></entry> <entry role="func_table_entry"><para role="func_signature">
<entry>Translates the given raw MLS/MCS range into qualified format if <function>sepgsql_setcon</function> ( <type>text</type> )
the mcstrans daemon is running. <returnvalue>boolean</returnvalue>
</entry> </para>
</row> <para>
<row> Switches the client domain of the current session to the new domain,
<entry><literal>sepgsql_restorecon(text) returns bool</literal></entry> if allowed by the security policy.
<entry> It also accepts <literal>NULL</literal> input as a request to transition
Sets up initial security labels for all objects within the to the client's original domain.
current database. The argument may be NULL, or the name of a specfile </para></entry>
to be used as alternative of the system default. </row>
</entry>
</row> <row>
</tbody> <entry role="func_table_entry"><para role="func_signature">
</tgroup> <function>sepgsql_mcstrans_in</function> ( <type>text</type> )
<returnvalue>text</returnvalue>
</para>
<para>
Translates the given qualified MLS/MCS range into raw format if
the mcstrans daemon is running.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<function>sepgsql_mcstrans_out</function> ( <type>text</type> )
<returnvalue>text</returnvalue>
</para>
<para>
Translates the given raw MLS/MCS range into qualified format if
the mcstrans daemon is running.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<function>sepgsql_restorecon</function> ( <type>text</type> )
<returnvalue>boolean</returnvalue>
</para>
<para>
Sets up initial security labels for all objects within the
current database. The argument may be <literal>NULL</literal>, or the
name of a specfile to be used as alternative of the system default.
</para></entry>
</row>
</tbody>
</tgroup>
</table> </table>
</sect2> </sect2>
......
...@@ -24,83 +24,99 @@ ...@@ -24,83 +24,99 @@
<title>Functions Provided</title> <title>Functions Provided</title>
<para> <para>
<xref linkend="tablefunc-functions"/> shows the functions provided <xref linkend="tablefunc-functions"/> summarizes the functions provided
by the <filename>tablefunc</filename> module. by the <filename>tablefunc</filename> module.
</para> </para>
<table id="tablefunc-functions"> <table id="tablefunc-functions">
<title><filename>tablefunc</filename> Functions</title> <title><filename>tablefunc</filename> Functions</title>
<tgroup cols="3"> <tgroup cols="1">
<thead> <thead>
<row> <row>
<entry>Function</entry> <entry role="func_table_entry"><para role="func_signature">
<entry>Returns</entry> Function
<entry>Description</entry> </para>
</row> <para>
</thead> Description
<tbody> </para></entry>
<row> </row>
<entry><function>normal_rand(int numvals, float8 mean, float8 stddev)</function></entry> </thead>
<entry><type>setof float8</type></entry>
<entry> <tbody>
Produces a set of normally distributed random values <row>
</entry> <entry role="func_table_entry"><para role="func_signature">
</row> <function>normal_rand</function> ( <parameter>numvals</parameter> <type>integer</type>, <parameter>mean</parameter> <type>float8</type>, <parameter>stddev</parameter> <type>float8</type> )
<row> <returnvalue>setof float8</returnvalue>
<entry><function>crosstab(text sql)</function></entry>
<entry><type>setof record</type></entry>
<entry>
Produces a <quote>pivot table</quote> containing
row names plus <replaceable>N</replaceable> value columns, where
<replaceable>N</replaceable> is determined by the row type specified in the calling
query
</entry>
</row>
<row>
<entry><function>crosstab<replaceable>N</replaceable>(text sql)</function></entry>
<entry><type>setof table_crosstab_<replaceable>N</replaceable></type></entry>
<entry>
Produces a <quote>pivot table</quote> containing
row names plus <replaceable>N</replaceable> value columns.
<function>crosstab2</function>, <function>crosstab3</function>, and
<function>crosstab4</function> are predefined, but you can create additional
<function>crosstab<replaceable>N</replaceable></function> functions as described below
</entry>
</row>
<row>
<entry><function>crosstab(text source_sql, text category_sql)</function></entry>
<entry><type>setof record</type></entry>
<entry>
Produces a <quote>pivot table</quote>
with the value columns specified by a second query
</entry>
</row>
<row>
<entry><function>crosstab(text sql, int N)</function></entry>
<entry><type>setof record</type></entry>
<entry>
<para>Obsolete version of <function>crosstab(text)</function>.
The parameter <replaceable>N</replaceable> is now ignored, since the number of
value columns is always determined by the calling query
</para> </para>
</entry> <para>
</row> Produces a set of normally distributed random values.
<row> </para></entry>
<entry> </row>
<function>
connectby(text relname, text keyid_fld, text parent_keyid_fld <row>
[, text orderby_fld ], text start_with, int max_depth <entry role="func_table_entry"><para role="func_signature">
[, text branch_delim ]) <function>crosstab</function> ( <parameter>sql</parameter> <type>text</type> )
</function> <returnvalue>setof record</returnvalue>
<indexterm><primary>connectby</primary></indexterm> </para>
</entry> <para>
<entry><type>setof record</type></entry> Produces a <quote>pivot table</quote> containing
<entry> row names plus <replaceable>N</replaceable> value columns, where
Produces a representation of a hierarchical tree structure <replaceable>N</replaceable> is determined by the row type specified
</entry> in the calling query.
</row> </para></entry>
</tbody> </row>
</tgroup>
<row>
<entry role="func_table_entry"><para role="func_signature">
<function>crosstab<replaceable>N</replaceable></function> ( <parameter>sql</parameter> <type>text</type> )
<returnvalue>setof table_crosstab_<replaceable>N</replaceable></returnvalue>
</para>
<para>
Produces a <quote>pivot table</quote> containing
row names plus <replaceable>N</replaceable> value columns.
<function>crosstab2</function>, <function>crosstab3</function>, and
<function>crosstab4</function> are predefined, but you can create additional
<function>crosstab<replaceable>N</replaceable></function> functions as described below.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<function>crosstab</function> ( <parameter>source_sql</parameter> <type>text</type>, <parameter>category_sql</parameter> <type>text</type> )
<returnvalue>setof record</returnvalue>
</para>
<para>
Produces a <quote>pivot table</quote>
with the value columns specified by a second query.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<function>crosstab</function> ( <parameter>sql</parameter> <type>text</type>, <parameter>N</parameter> <type>integer</type> )
<returnvalue>setof record</returnvalue>
</para>
<para>
Obsolete version of <function>crosstab(text)</function>.
The parameter <parameter>N</parameter> is now ignored, since the
number of value columns is always determined by the calling query.
</para></entry>
</row>
<row>
<entry role="func_table_entry"><para role="func_signature">
<indexterm><primary>connectby</primary></indexterm>
<function>connectby</function> ( <parameter>relname</parameter> <type>text</type>, <parameter>keyid_fld</parameter> <type>text</type>, <parameter>parent_keyid_fld</parameter> <type>text</type>
<optional>, <parameter>orderby_fld</parameter> <type>text</type> </optional>, <parameter>start_with</parameter> <type>text</type>, <parameter>max_depth</parameter> <type>integer</type>
<optional>, <parameter>branch_delim</parameter> <type>text</type> </optional> )
<returnvalue>setof record</returnvalue>
</para>
<para>
Produces a representation of a hierarchical tree structure.
</para></entry>
</row>
</tbody>
</tgroup>
</table> </table>
<sect3> <sect3>
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment