aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorJoe Conway <mail@joeconway.com>2004-07-02 18:59:25 +0000
committerJoe Conway <mail@joeconway.com>2004-07-02 18:59:25 +0000
commit0b89d261c7a91ff9ebc6a6b9bd3ee129576bdd9a (patch)
treebe0e9be6e1964c6c5b8d6776b2a266a88cfdf068 /doc/src
parent6d6c8b0d96a75f804d49f046f2fad8c60ea55fbe (diff)
downloadpostgresql-0b89d261c7a91ff9ebc6a6b9bd3ee129576bdd9a.tar.gz
postgresql-0b89d261c7a91ff9ebc6a6b9bd3ee129576bdd9a.zip
Andreas Pflug wrote:
From an idea of Bruce, the attached patch implements the function pg_tablespace_databases(oid) RETURNS SETOF oid which delivers as set of database oids having objects in the selected tablespace, enabling an admin to examine only the databases affecting the tablespace for objects instead of scanning all of them. initdb forced
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/func.sgml21
1 files changed, 20 insertions, 1 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 3c23f43a59f..8a624614e8d 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -1,5 +1,5 @@
<!--
-$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.211 2004/06/25 17:20:21 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.212 2004/07/02 18:59:20 joe Exp $
PostgreSQL documentation
-->
@@ -7232,6 +7232,10 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<primary>pg_get_serial_sequence</primary>
</indexterm>
+ <indexterm zone="functions-misc">
+ <primary>pg_tablespace_databases</primary>
+ </indexterm>
+
<para>
<xref linkend="functions-misc-catalog-table"> lists functions that
extract information from the system catalogs.
@@ -7325,6 +7329,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
<entry>get name of the sequence that a serial or bigserial column
uses</entry>
</row>
+ <row>
+ <entry><literal><function>pg_tablespace_databases</function>(<parameter>tablespace_oid</parameter>)</literal></entry>
+ <entry><type>setof oid</type></entry>
+ <entry>get set of database oids that have objects in the tablespace</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -7362,6 +7371,16 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
NULL is returned if the column does not have a sequence attached.
</para>
+ <para>
+ <function>pg_tablespace_databases</function> allows usage examination of a
+ tablespace. It will return a set of database oids, that have objects
+ stored in the tablespace. If this function returns any row, the
+ tablespace is assumed not to be empty and cannot be dropped. To
+ display the actual objects populating the tablespace, you will need
+ to connect to the databases returned by
+ <function>pg_tablespace_databases</function> to query pg_class.
+ </para>
+
<indexterm zone="functions-misc">
<primary>obj_description</primary>
</indexterm>