|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.451 2008/10/27 09:37:46 petere Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.452 2008/11/03 17:51:12 tgl Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="functions">
|
4 | 4 | <title>Functions and Operators</title>
|
@@ -11643,6 +11643,10 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
11643 | 11643 | <primary>pg_tablespace_databases</primary>
|
11644 | 11644 | </indexterm>
|
11645 | 11645 |
|
| 11646 | + <indexterm> |
| 11647 | + <primary>pg_typeof</primary> |
| 11648 | + </indexterm> |
| 11649 | + |
11646 | 11650 | <para>
|
11647 | 11651 | <xref linkend="functions-info-catalog-table"> lists functions that
|
11648 | 11652 | extract information from the system catalogs.
|
@@ -11766,6 +11770,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
11766 | 11770 | <entry><type>setof oid</type></entry>
|
11767 | 11771 | <entry>get the set of database OIDs that have objects in the tablespace</entry>
|
11768 | 11772 | </row>
|
| 11773 | + <row> |
| 11774 | + <entry><literal><function>pg_typeof</function>(<parameter>any</parameter>)</literal></entry> |
| 11775 | + <entry><type>regtype</type></entry> |
| 11776 | + <entry>get the data type of any value</entry> |
| 11777 | + </row> |
11769 | 11778 | </tbody>
|
11770 | 11779 | </tgroup>
|
11771 | 11780 | </table>
|
@@ -11848,6 +11857,12 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
11848 | 11857 | <structname>pg_class</> catalogs.
|
11849 | 11858 | </para>
|
11850 | 11859 |
|
| 11860 | + <para> |
| 11861 | + <function>pg_typeof</function> returns the OID of the data type of the |
| 11862 | + value that is passed to it. This can be helpful for troubleshooting or |
| 11863 | + dynamically constructing SQL queries. |
| 11864 | + </para> |
| 11865 | + |
11851 | 11866 | <indexterm>
|
11852 | 11867 | <primary>col_description</primary>
|
11853 | 11868 | </indexterm>
|
|