diff options
author | Robert Haas <rhaas@postgresql.org> | 2022-09-28 09:45:27 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2022-09-28 09:55:28 -0400 |
commit | a448e49bcbe40fb72e1ed85af910dd216d45bad8 (patch) | |
tree | 2815aed4f5e89bdea91cdd35ec89facaa846e438 /src/backend/utils/adt | |
parent | 6af082723277eeca74f2da65e7759666bf7c7f9c (diff) | |
download | postgresql-a448e49bcbe40fb72e1ed85af910dd216d45bad8.tar.gz postgresql-a448e49bcbe40fb72e1ed85af910dd216d45bad8.zip |
Revert 56-bit relfilenode change and follow-up commits.
There are still some alignment-related failures in the buildfarm,
which might or might not be able to be fixed quickly, but I've also
just realized that it increased the size of many WAL records by 4 bytes
because a block reference contains a RelFileLocator. The effect of that
hasn't been studied or discussed, so revert for now.
Diffstat (limited to 'src/backend/utils/adt')
-rw-r--r-- | src/backend/utils/adt/dbsize.c | 7 | ||||
-rw-r--r-- | src/backend/utils/adt/pg_upgrade_support.c | 13 |
2 files changed, 5 insertions, 15 deletions
diff --git a/src/backend/utils/adt/dbsize.c b/src/backend/utils/adt/dbsize.c index 9f70f3526c9..34efa121b40 100644 --- a/src/backend/utils/adt/dbsize.c +++ b/src/backend/utils/adt/dbsize.c @@ -878,7 +878,7 @@ pg_relation_filenode(PG_FUNCTION_ARGS) if (!RelFileNumberIsValid(result)) PG_RETURN_NULL(); - PG_RETURN_INT64(result); + PG_RETURN_OID(result); } /* @@ -898,12 +898,9 @@ Datum pg_filenode_relation(PG_FUNCTION_ARGS) { Oid reltablespace = PG_GETARG_OID(0); - RelFileNumber relfilenumber = PG_GETARG_INT64(1); + RelFileNumber relfilenumber = PG_GETARG_OID(1); Oid heaprel; - /* check whether the relfilenumber is within a valid range */ - CHECK_RELFILENUMBER_RANGE(relfilenumber); - /* test needed so RelidByRelfilenumber doesn't misbehave */ if (!RelFileNumberIsValid(relfilenumber)) PG_RETURN_NULL(); diff --git a/src/backend/utils/adt/pg_upgrade_support.c b/src/backend/utils/adt/pg_upgrade_support.c index fc2faed9a7d..797f5f539af 100644 --- a/src/backend/utils/adt/pg_upgrade_support.c +++ b/src/backend/utils/adt/pg_upgrade_support.c @@ -17,7 +17,6 @@ #include "catalog/pg_type.h" #include "commands/extension.h" #include "miscadmin.h" -#include "storage/relfilelocator.h" #include "utils/array.h" #include "utils/builtins.h" @@ -99,12 +98,10 @@ binary_upgrade_set_next_heap_pg_class_oid(PG_FUNCTION_ARGS) Datum binary_upgrade_set_next_heap_relfilenode(PG_FUNCTION_ARGS) { - RelFileNumber relfilenumber = PG_GETARG_INT64(0); + RelFileNumber relfilenumber = PG_GETARG_OID(0); CHECK_IS_BINARY_UPGRADE; - CHECK_RELFILENUMBER_RANGE(relfilenumber); binary_upgrade_next_heap_pg_class_relfilenumber = relfilenumber; - SetNextRelFileNumber(relfilenumber + 1); PG_RETURN_VOID(); } @@ -123,12 +120,10 @@ binary_upgrade_set_next_index_pg_class_oid(PG_FUNCTION_ARGS) Datum binary_upgrade_set_next_index_relfilenode(PG_FUNCTION_ARGS) { - RelFileNumber relfilenumber = PG_GETARG_INT64(0); + RelFileNumber relfilenumber = PG_GETARG_OID(0); CHECK_IS_BINARY_UPGRADE; - CHECK_RELFILENUMBER_RANGE(relfilenumber); binary_upgrade_next_index_pg_class_relfilenumber = relfilenumber; - SetNextRelFileNumber(relfilenumber + 1); PG_RETURN_VOID(); } @@ -147,12 +142,10 @@ binary_upgrade_set_next_toast_pg_class_oid(PG_FUNCTION_ARGS) Datum binary_upgrade_set_next_toast_relfilenode(PG_FUNCTION_ARGS) { - RelFileNumber relfilenumber = PG_GETARG_INT64(0); + RelFileNumber relfilenumber = PG_GETARG_OID(0); CHECK_IS_BINARY_UPGRADE; - CHECK_RELFILENUMBER_RANGE(relfilenumber); binary_upgrade_next_toast_pg_class_relfilenumber = relfilenumber; - SetNextRelFileNumber(relfilenumber + 1); PG_RETURN_VOID(); } |