summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-11-03 17:51:13 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-11-03 17:51:13 +0000
commitb8fab2411dbb08d918d5998ee78325d2a0549c7f (patch)
tree617a8124cf945741d9be116d74401c29f0accc45 /doc/src
parent06c22d7f519cede815bbec96b490727fd8b5c229 (diff)
Add pg_typeof() function.
Brendan Jurd
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml17
1 files changed, 16 insertions, 1 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index df6045fc70e..7cfb1219889 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.451 2008/10/27 09:37:46 petere Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.452 2008/11/03 17:51:12 tgl Exp $ -->
<chapter id="functions">
<title>Functions and Operators</title>
@@ -11643,6 +11643,10 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<primary>pg_tablespace_databases</primary>
</indexterm>
+ <indexterm>
+ <primary>pg_typeof</primary>
+ </indexterm>
+
<para>
<xref linkend="functions-info-catalog-table"> lists functions that
extract information from the system catalogs.
@@ -11766,6 +11770,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<entry><type>setof oid</type></entry>
<entry>get the set of database OIDs that have objects in the tablespace</entry>
</row>
+ <row>
+ <entry><literal><function>pg_typeof</function>(<parameter>any</parameter>)</literal></entry>
+ <entry><type>regtype</type></entry>
+ <entry>get the data type of any value</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -11848,6 +11857,12 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<structname>pg_class</> catalogs.
</para>
+ <para>
+ <function>pg_typeof</function> returns the OID of the data type of the
+ value that is passed to it. This can be helpful for troubleshooting or
+ dynamically constructing SQL queries.
+ </para>
+
<indexterm>
<primary>col_description</primary>
</indexterm>