Add relation fork support to pg_relation_size() function. You can now pass
Heikki Linnakangas <heikki.linnakangas@iki.fi>
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.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +18 −20 |
| src/backend/utils/adt/dbsize.c | modified | +39 −36 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_proc.h | modified | +5 −7 |
| src/include/storage/relfilenode.h | modified | +5 −2 |
| src/include/utils/builtins.h | modified | +3 −5 |