mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Add a couple of information functions to support direct checks on whether
a schema is our own temp schema or another backend's temp schema, and use these in place of some former kluges in information_schema. Per my proposal of yesterday.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.336 2006/09/10 19:03:57 tgl Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.337 2006/09/14 22:05:05 tgl Exp $ -->
|
||||
|
||||
<chapter id="functions">
|
||||
<title>Functions and Operators</title>
|
||||
@@ -9232,6 +9232,18 @@ select current_date + s.a as dates from generate_series(0,14,7) as s(a);
|
||||
<entry>port of the local connection</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal><function>pg_my_temp_schema</function>()</literal></entry>
|
||||
<entry><type>oid</type></entry>
|
||||
<entry>OID of session's temporary schema, or 0 if none</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal><function>pg_is_other_temp_schema</function>(<type>oid</type>)</literal></entry>
|
||||
<entry><type>boolean</type></entry>
|
||||
<entry>is schema another session's temporary schema?</entry>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<entry><literal><function>pg_postmaster_start_time</function>()</literal></entry>
|
||||
<entry><type>timestamp with time zone</type></entry>
|
||||
@@ -9343,6 +9355,24 @@ SET search_path TO <replaceable>schema</> <optional>, <replaceable>schema</>, ..
|
||||
Unix-domain socket.
|
||||
</para>
|
||||
|
||||
<indexterm zone="functions-info">
|
||||
<primary>pg_my_temp_schema</primary>
|
||||
</indexterm>
|
||||
|
||||
<indexterm zone="functions-info">
|
||||
<primary>pg_is_other_temp_schema</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>
|
||||
<function>pg_my_temp_schema</function> returns the OID of the current
|
||||
session's temporary schema, or 0 if it has none (because it has not
|
||||
created any temporary tables).
|
||||
<function>pg_is_other_temp_schema</function> returns true if the
|
||||
given OID is the OID of any other session's temporary schema.
|
||||
(This can be useful, for example, to exclude other sessions' temporary
|
||||
tables from a catalog display.)
|
||||
</para>
|
||||
|
||||
<indexterm zone="functions-info">
|
||||
<primary>pg_postmaster_start_time</primary>
|
||||
</indexterm>
|
||||
|
Reference in New Issue
Block a user