diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-10-06 14:13:17 +0000 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2008-10-06 14:13:17 +0000 |
commit | 5f853c655663bf829c02895de2b445a5f3caa24b (patch) | |
tree | 3dc2757ce91d5409d1def38bbbf666fbfd8aae6d /src/backend/utils/adt/dbsize.c | |
parent | e59ad5fbb6d71b43a6c4e50875fda56e88527532 (diff) | |
download | postgresql-5f853c655663bf829c02895de2b445a5f3caa24b.tar.gz postgresql-5f853c655663bf829c02895de2b445a5f3caa24b.zip |
Use fork names instead of numbers in the file names for additional
relation forks. While the file names are not visible to users, for those
that do peek into the data directory, it's nice to have more descriptive
names. Per Greg Stark's suggestion.
Diffstat (limited to 'src/backend/utils/adt/dbsize.c')
-rw-r--r-- | src/backend/utils/adt/dbsize.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index d225b3e7c75..4d3f8c0b5ce 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -5,7 +5,7 @@ * Copyright (c) 2002-2008, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/dbsize.c,v 1.21 2008/10/03 07:33:09 heikki Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/dbsize.c,v 1.22 2008/10/06 14:13:17 heikki Exp $ * */ @@ -283,35 +283,6 @@ calculate_relation_size(RelFileNode *rfn, ForkNumber forknum) return totalsize; } - -/* - * XXX: Consider making this global and moving elsewhere. But currently - * there's no other users for this. - * - * Remember to also update the errhint below if you add entries, and the - * documentation for pg_relation_size(). - */ -static char *forkNames[] = { - "main", /* MAIN_FORKNUM */ - "fsm" /* FSM_FORKNUM */ -}; - -static ForkNumber -forkname_to_number(char *forkName) -{ - ForkNumber forkNum; - - for (forkNum = 0; forkNum <= MAX_FORKNUM; forkNum++) - if (strcmp(forkNames[forkNum], forkName) == 0) - return forkNum; - - ereport(ERROR, - (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("invalid fork name"), - errhint("Valid fork names are 'main' and 'fsm'"))); - return InvalidForkNumber; /* keep compiler quiet */ -} - Datum pg_relation_size(PG_FUNCTION_ARGS) { |