diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-10-03 07:33:10 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-10-03 07:33:10 +0000 |
commit | 706a308806a066017c63024c454bb02953c9822c (patch) | |
tree | 4c763cb1f96c4b89caec213c123bdc5b910991bd /src/include/utils/builtins.h | |
parent | 2cc1633a35a57fe2c2670c43691ab9ffa582f3ff (diff) |
Add relation fork support to pg_relation_size() function. You can now pass
name of a fork ('main' or 'fsm', at the moment) to pg_relation_size() to
get the size of a specific fork. Defaults to 'main', if none given.
While we're at it, modify pg_relation_size to take a regclass as argument,
instead of separate variants taking oid and name. This change is
transparent to typical use where the table name is passed as a string
literal, like pg_relation_size('table'), but will break queries like
pg_relation_size(namecol), where namecol is of type name. text-type input
still works, and using a non-schema-qualified table name is not very
reliable anyway, so this is unlikely to break anyone's queries in practice.
Diffstat (limited to 'src/include/utils/builtins.h')
-rw-r--r-- | src/include/utils/builtins.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 09d38e9c1c3..58ccb03429d 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.320 2008/09/06 00:01:25 tgl Exp $ + * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.321 2008/10/03 07:33:10 heikki Exp $ * *------------------------------------------------------------------------- */ @@ -389,10 +389,8 @@ extern Datum pg_tablespace_size_oid(PG_FUNCTION_ARGS); extern Datum pg_tablespace_size_name(PG_FUNCTION_ARGS); extern Datum pg_database_size_oid(PG_FUNCTION_ARGS); extern Datum pg_database_size_name(PG_FUNCTION_ARGS); -extern Datum pg_relation_size_oid(PG_FUNCTION_ARGS); -extern Datum pg_relation_size_name(PG_FUNCTION_ARGS); -extern Datum pg_total_relation_size_oid(PG_FUNCTION_ARGS); -extern Datum pg_total_relation_size_name(PG_FUNCTION_ARGS); +extern Datum pg_relation_size(PG_FUNCTION_ARGS); +extern Datum pg_total_relation_size(PG_FUNCTION_ARGS); extern Datum pg_size_pretty(PG_FUNCTION_ARGS); /* genfile.c */ |