BUG #14825: enum type: unsafe use?
balazs@obiserver.hu
From: balazs@obiserver.hu
To: pgsql-bugs@postgresql.org
Cc: balazs@obiserver.hu
Date: 2017-09-22T18:59:04Z
Lists: pgsql-bugs, pgsql-hackers
The following bug has been logged on the website:
Bug reference: 14825
Logged by: Balazs Szilfai
Email address: balazs@obiserver.hu
PostgreSQL version: 10beta4
Operating system: Debian Linux
Description:
Hi,
version: 10rc1
testdb=# begin;
BEGIN
testdb=# create type enumtype as enum ('v1', 'v2');
CREATE TYPE
testdb=# create table testtable (enumcolumn enumtype not null default
'v1');
CREATE TABLE
Everything it's OK! :)
If enum type have "owner to":
testdb=# begin;
BEGIN
testdb=# create type enumtype as enum ('v1', 'v2');
CREATE TYPE
testdb=# alter type enumtype owner to testrole;
ALTER TYPE
testdb=# create table testtable (enumcolumn enumtype not null default
'v1');
ERROR: unsafe use of new value "v1" of enum type enumtype
HINT: New enum values must be committed before they can be used.
Is this unsafe?
Balazs
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