summaryrefslogtreecommitdiff
path: root/src/backend/catalog/heap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/catalog/heap.c')
-rw-r--r--src/backend/catalog/heap.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index 33eef9f1ca..c346edac93 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -1088,19 +1088,21 @@ heap_create_with_catalog(const char *relname,
*/
if (!OidIsValid(relid))
{
- /*
- * Use binary-upgrade override for pg_class.oid/relfilenode, if
- * supplied.
- */
+ /* Use binary-upgrade override for pg_class.oid/relfilenode? */
if (IsBinaryUpgrade &&
- OidIsValid(binary_upgrade_next_heap_pg_class_oid) &&
(relkind == RELKIND_RELATION || relkind == RELKIND_SEQUENCE ||
relkind == RELKIND_VIEW || relkind == RELKIND_MATVIEW ||
relkind == RELKIND_COMPOSITE_TYPE || relkind == RELKIND_FOREIGN_TABLE))
{
+ if (!OidIsValid(binary_upgrade_next_heap_pg_class_oid))
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+ errmsg("pg_class heap OID value not set when in binary upgrade mode")));
+
relid = binary_upgrade_next_heap_pg_class_oid;
binary_upgrade_next_heap_pg_class_oid = InvalidOid;
}
+ /* There might be no TOAST table, so we have to test for it. */
else if (IsBinaryUpgrade &&
OidIsValid(binary_upgrade_next_toast_pg_class_oid) &&
relkind == RELKIND_TOASTVALUE)