Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit399ad77

Browse files
committed
Improve documentation of pg_typeof, per gripe from David Wheeler.
1 parent6517f37 commit399ad77

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.455 2008/11/04 14:49:11 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.456 2008/11/07 22:54:41 tgl Exp $ -->
22

33
<chapter id="functions">
44
<title>Functions and Operators</title>
@@ -11871,7 +11871,24 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
1187111871
<para>
1187211872
<function>pg_typeof</function> returns the OID of the data type of the
1187311873
value that is passed to it. This can be helpful for troubleshooting or
11874-
dynamically constructing SQL queries.
11874+
dynamically constructing SQL queries. The function is declared as
11875+
returning <type>regtype</>, which is an OID alias type (see
11876+
<xref linkend="datatype-oid">); this means that it is the same as an
11877+
OID for comparison purposes but displays as a type name. For example:
11878+
<programlisting>
11879+
SELECT pg_typeof(33);
11880+
11881+
pg_typeof
11882+
-----------
11883+
integer
11884+
(1 row)
11885+
11886+
SELECT typlen FROM pg_type WHERE oid = pg_typeof(33);
11887+
typlen
11888+
--------
11889+
4
11890+
(1 row)
11891+
</programlisting>
1187511892
</para>
1187611893

1187711894
<indexterm>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp