aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-02-27 15:18:17 +0900
committerMichael Paquier <michael@paquier.xyz>2024-02-27 15:18:17 +0900
commitef5e2e90859a39efdd3a78e528c544b585295a78 (patch)
treed8862c9ff15c9823a788f77263a97bbd82f5e8d4 /src/include
parent743112a2e9938b98d716384fa9374c41afe74e41 (diff)
downloadpostgresql-ef5e2e90859a39efdd3a78e528c544b585295a78.tar.gz
postgresql-ef5e2e90859a39efdd3a78e528c544b585295a78.zip
Remove unnecessary array object_classes[] in dependency.c
object_classes[] provided unnecessary indirection between catalog OIDs and the enum ObjectClass when calling add_object_address(). This array has been originally introduced in 30ec31604d5 and was useful because not all relation OIDs were compile-time constants back then, which has not been the case for a long time now for all the elements of ObjectClass. This commit removes object_classes[], switching to the catalog OIDs when calling add_object_address(). This shaves some code while saving in maintenance because it was necessary to maintain the enum ObjectClass and the array in sync when adding new object types. Reported-by: Jeff Davis Author: Jelte Fennema-Nio Reviewed-by: Jian He, Michael Paquier Discussion: https://postgr.es/m/CAGECzQT3caUbcCcszNewCCmMbCuyP7XNAm60J3ybd6PN5kH2Dw@mail.gmail.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/dependency.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/include/catalog/dependency.h b/src/include/catalog/dependency.h
index fd588659014..436b081738b 100644
--- a/src/include/catalog/dependency.h
+++ b/src/include/catalog/dependency.h
@@ -83,7 +83,7 @@ typedef struct ObjectAddresses ObjectAddresses;
/*
* This enum covers all system catalogs whose OIDs can appear in
- * pg_depend.classId or pg_shdepend.classId. Keep object_classes[] in sync.
+ * pg_depend.classId or pg_shdepend.classId.
*/
typedef enum ObjectClass
{
@@ -130,8 +130,6 @@ typedef enum ObjectClass
OCLASS_TRANSFORM, /* pg_transform */
} ObjectClass;
-#define LAST_OCLASS OCLASS_TRANSFORM
-
/* flag bits for performDeletion/performMultipleDeletions: */
#define PERFORM_DELETION_INTERNAL 0x0001 /* internal action */
#define PERFORM_DELETION_CONCURRENTLY 0x0002 /* concurrent drop */