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: "David E. Wheeler" <david@justatheory.com>,
Christophe Pettus <christophe.pettus@pgexperts.com>,
pgsql-bugs@postgresql.org, pgsql-hackers@postgresql.org
Date: 2017-09-26T18:37:46Z
Lists: pgsql-bugs, pgsql-hackers
I wrote: > Pushed; sorry for the delay. ... and the buildfarm's not too happy. It looks like force_parallel_mode breaks all the regression test cases around unsafe enums; which on reflection is unsurprising, because parallel workers will not have access to the parent's blacklist hash, so they will think unsafe values are safe. Now, as long as parallel workers are read-only, perhaps this matters little; they would not be allowed to write unsafe values into tables anyway. I'm concerned though about whether it might be possible for a parallel worker to return an unsafe value to the parent (in OID form) and then the parent writes it into a table. If we can convince ourselves that's not possible, it might be okay to just turn off force_parallel_mode for these test cases. A safer answer would be to mark enum_in() and other callers of check_safe_enum_use() as parallel-restricted. That'd require a post-RC1 catversion bump, which seems pretty unpleasant, but none of the other answers are nice either. Transmitting the blacklist hash to workers would be a good long-term answer, but I don't want to try to shoehorn it in for v10. Another idea is that maybe the existence of a blacklist hash should be enough to turn off parallel mode altogether ... but ugh. Or maybe we're back to "revert the whole feature, go back to 9.6 behavior". Thoughts? 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