From 5f853c655663bf829c02895de2b445a5f3caa24b Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Mon, 6 Oct 2008 14:13:17 +0000 Subject: 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. --- src/backend/utils/adt/dbsize.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'src/backend/utils/adt/dbsize.c') 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) { -- cgit v1.2.3