diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2015-07-21 13:20:53 +0200 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2015-07-21 13:20:53 +0200 |
commit | d6ec181cf14a1d3f3d8ca9400a404b9828776ca3 (patch) | |
tree | ed32e2e97ed2a783d56f506505f8e47e36447c48 /src/backend/commands/event_trigger.c | |
parent | e015c3e51f76a05cc026c8323c51a373172adaa3 (diff) | |
download | postgresql-d6ec181cf14a1d3f3d8ca9400a404b9828776ca3.tar.gz postgresql-d6ec181cf14a1d3f3d8ca9400a404b9828776ca3.zip |
Fix omission of OCLASS_TRANSFORM in object_classes[]
This was forgotten in cac76582053e (and its fixup ad89a5d115). Since it
seems way too easy to miss this, this commit also introduces a mechanism
to enforce that the array is consistent with the enum.
Problem reported independently by Robert Haas and Jaimin Pan.
Patches proposed by Jaimin Pan, Jim Nasby, Michael Paquier and myself,
though I didn't use any of these and instead went with a cleaner
approach suggested by Tom Lane.
Backpatch to 9.5.
Discussion:
https://www.postgresql.org/message-id/CA+Tgmoa6SgDaxW_n_7SEhwBAc=mniYga+obUj5fmw4rU9_mLvA@mail.gmail.com
https://www.postgresql.org/message-id/29788.1437411581@sss.pgh.pa.us
Diffstat (limited to 'src/backend/commands/event_trigger.c')
-rw-r--r-- | src/backend/commands/event_trigger.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c index bf40881037c..3d1cb0b8e30 100644 --- a/src/backend/commands/event_trigger.c +++ b/src/backend/commands/event_trigger.c @@ -1168,15 +1168,6 @@ EventTriggerSupportsObjectClass(ObjectClass objclass) case OCLASS_EXTENSION: case OCLASS_POLICY: return true; - - case MAX_OCLASS: - - /* - * This shouldn't ever happen, but we keep the case to avoid a - * compiler warning without a "default" clause in the switch. - */ - Assert(false); - break; } return true; |