From 1dc118660b8f12d3bdec94b6f6e1068966ca62e9 Mon Sep 17 00:00:00 2001 From: Fujii Masao Date: Fri, 19 Jul 2013 03:50:20 +0900 Subject: Fix pgstattuple functions to use regclass-type as the argument. This allows us to specify the target relation with several expressions, 'relname', 'schemaname.relname' and OID in all pgstattuple functions. pgstatindex() and pg_relpages() could not accept OID as the argument so far. Per discussion on -hackers, we decided to keep two types of interfaces, with regclass-type and TEXT-type argument, for each pgstattuple function because of the backward-compatibility issue. The functions which have TEXT-type argument will be deprecated in the future release. Patch by Satoshi Nagayasu, reviewed by Rushabh Lathia and Fujii Masao. --- doc/src/sgml/pgstattuple.sgml | 47 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/pgstattuple.sgml b/doc/src/sgml/pgstattuple.sgml index f2bc2a68f88..6cae04a9c8b 100644 --- a/doc/src/sgml/pgstattuple.sgml +++ b/doc/src/sgml/pgstattuple.sgml @@ -22,7 +22,7 @@ - pgstattuple(text) returns record + pgstattuple(regclass) returns record @@ -30,7 +30,7 @@ pgstattuple returns a relation's physical length, percentage of dead tuples, and other info. This may help users to determine whether vacuum is necessary or not. The argument is the - target relation's name (optionally schema-qualified). + target relation's name (optionally schema-qualified) or OID. For example: test=> SELECT * FROM pgstattuple('pg_catalog.pg_proc'); @@ -125,13 +125,15 @@ free_percent | 1.95 - pgstattuple(oid) returns record + pgstattuple(text) returns record - This is the same as pgstattuple(text), except - that the target relation is specified by OID. + This is the same as pgstattuple(regclass), except + that the target relation is specified by TEXT. This function is kept + because of backward-compatibility so far, and will be deprecated in + the future release. @@ -141,7 +143,7 @@ free_percent | 1.95 pgstatindex - pgstatindex(text) returns record + pgstatindex(regclass) returns record @@ -251,6 +253,21 @@ leaf_fragmentation | 0 + + + pgstatindex(text) returns record + + + + + This is the same as pgstatindex(regclass), except + that the target index is specified by TEXT. This function is kept + because of backward-compatibility so far, and will be deprecated in + the future release. + + + + @@ -316,7 +333,7 @@ pending_tuples | 0 pg_relpages - pg_relpages(text) returns bigint + pg_relpages(regclass) returns bigint @@ -326,6 +343,22 @@ pending_tuples | 0 + + + + pg_relpages(text) returns bigint + + + + + This is the same as pg_relpages(regclass), except + that the target relation is specified by TEXT. This function is kept + because of backward-compatibility so far, and will be deprecated in + the future release. + + + + -- cgit v1.2.3