Re: BUG #14825: enum type: unsafe use?
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: balazs@obiserver.hu, pgsql-bugs@postgresql.org,
pgsql-hackers@postgresql.org
Date: 2017-09-23T03:19:52Z
Lists: pgsql-bugs, pgsql-hackers
Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes: > On 09/22/2017 05:46 PM, Tom Lane wrote: >> I'm not sure if that qualifies as a stop-ship problem, but it ain't >> good, for sure. We need to look at whether we should revert 15bc038f9 >> or somehow revise its rules. > I wonder if we wouldn't be better > doing this more directly, keeping a per-transaction hash of unsafe enum > values (which will almost always be empty). It might even speed up the > check. Yeah, I was considering the same thing over dinner, though I'd phrase it oppositely: keep a list of enum type OIDs created in the current transaction, so that we could whitelist them. This could maybe become a problem if someone created a zillion enums in one xact, though. The immediate question is do we care to design/implement such a thing post-RC1. I'd have to vote "no". I think the most prudent thing to do is revert 15bc038f9 and then have another go at it during the v11 cycle. regards, tom lane
Commits
-
Revert to 9.6 treatment of ALTER TYPE enumtype ADD VALUE.
- 28e072707685 11.0 landed
- 93a1af0b3f63 10.0 landed
-
Remove heuristic same-transaction test from check_safe_enum_use().
- 01c5de88ff24 10.0 landed
- 984c92074d84 11.0 landed
-
Use a blacklist to distinguish original from add-on enum values.
- 175774d2932d 10.0 landed
- 1635e80d30b1 11.0 landed
-
Add support for coordinating record typmods among parallel workers.
- cc5f81366c36 11.0 cited