From e4d9b69779157935c4d3087b9ab67ac7dfdec9b4 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Fri, 16 Sep 2005 05:35:41 +0000 Subject: [PATCH] Rename pg_complete_relation_size() to pg_total_relation_size(), for the sake of brevity and clarity. Make pg_reload_conf(), pg_rotate_logfile(), and pg_cancel_backend() return a boolean rather than an integer to indicate success or failure. Along the way, make some minor cleanups to dbsize.c -- in particular, use elog() rather than ereport() for "shouldn't happen" error conditions, and remove some of the more flagrant violations of the Postgres indentation conventions. Catalog version bumped. --- doc/src/sgml/func.sgml | 57 +++++++++++++++++-------------- doc/src/sgml/release.sgml | 12 +++++-- src/backend/utils/adt/dbsize.c | 58 +++++++++++++++----------------- src/backend/utils/adt/misc.c | 26 ++++++-------- src/include/catalog/catversion.h | 4 +-- src/include/catalog/pg_proc.h | 12 +++---- src/include/utils/builtins.h | 6 ++-- 7 files changed, 90 insertions(+), 85 deletions(-) diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index eaebce24c7c..c6c9d87e8a5 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,5 +1,5 @@ @@ -9368,21 +9368,21 @@ SELECT set_config('log_statement_stats', 'off', false); pg_cancel_backend(pid int) - int + boolean Cancel a backend's current query pg_reload_conf() - int + boolean Cause server processes to reload their configuration files pg_rotate_logfile() - int + boolean Rotate server's logfile @@ -9390,7 +9390,8 @@ SELECT set_config('log_statement_stats', 'off', false); - Each of these functions returns 1 if successful, 0 if not successful. + Each of these functions returns true if + successful and false otherwise. @@ -9502,7 +9503,7 @@ SELECT set_config('log_statement_stats', 'off', false); pg_relation_size - pg_complete_relation_size + pg_total_relation_size pg_size_pretty @@ -9527,28 +9528,28 @@ SELECT set_config('log_statement_stats', 'off', false); pg_tablespace_size(oid) bigint - Total disk space used by the tablespace with the specified OID + Disk space used by the tablespace with the specified OID pg_tablespace_size(name) bigint - Total disk space used by the tablespace with the specified name + Disk space used by the tablespace with the specified name pg_database_size(oid) bigint - Total disk space used by the database with the specified OID + Disk space used by the database with the specified OID pg_database_size(name) bigint - Total disk space used by the database with the specified name + Disk space used by the database with the specified name @@ -9562,25 +9563,31 @@ SELECT set_config('log_statement_stats', 'off', false); pg_relation_size(text) bigint - Disk space used by the table or index with the specified name. - The name may be qualified with a schema name + + Disk space used by the table or index with the specified name. + The table name may be qualified with a schema name + - pg_complete_relation_size(oid) + pg_total_relation_size(oid) bigint - Total disk space used by the table with the specified OID, - including indexes and toasted data + + Total disk space used by the table with the specified OID, + including indexes and toasted data + - pg_complete_relation_size(text) + pg_total_relation_size(text) bigint - Total disk space used by the table with the specified name, - including indexes and toasted data. - The table name may be qualified with a schema name + + Total disk space used by the table with the specified name, + including indexes and toasted data. The table name may be + qualified with a schema name + @@ -9610,9 +9617,9 @@ SELECT set_config('log_statement_stats', 'off', false); - pg_complete_relation_size accepts the OID or name of a table - or toast table, and returns the size in bytes of the data and all - associated indexes and toast tables. + pg_total_relation_size accepts the OID or name of a + table or toast table, and returns the size in bytes of the data + and all associated indexes and toast tables. @@ -9669,7 +9676,7 @@ SELECT set_config('log_statement_stats', 'off', false); pg_ls_dir - pg_ls_dir() returns all the names in the specified + pg_ls_dir returns all the names in the specified directory, except the special entries . and ... @@ -9678,7 +9685,7 @@ SELECT set_config('log_statement_stats', 'off', false); pg_read_file - pg_read_file() returns part of a text file, starting + pg_read_file returns part of a text file, starting at the given offset, returning at most length bytes (less if the end of file is reached first). If offset is negative, it is relative to the end of the file. @@ -9688,7 +9695,7 @@ SELECT set_config('log_statement_stats', 'off', false); pg_stat_file - pg_stat_file() returns a record containing the file + pg_stat_file returns a record containing the file size, last accessed timestamp, last modified timestamp, last file status change timestamp (Unix platforms only), file creation timestamp (Win32 only), and a boolean indicating diff --git a/doc/src/sgml/release.sgml b/doc/src/sgml/release.sgml index 3bbb6da4e84..6300a89a6bc 100644 --- a/doc/src/sgml/release.sgml +++ b/doc/src/sgml/release.sgml @@ -1,5 +1,5 @@