diff options
Diffstat (limited to 'src/test/regress/expected/enum.out')
-rw-r--r-- | src/test/regress/expected/enum.out | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/regress/expected/enum.out b/src/test/regress/expected/enum.out index ed729dddc3f..36826428a07 100644 --- a/src/test/regress/expected/enum.out +++ b/src/test/regress/expected/enum.out @@ -556,6 +556,30 @@ ERROR: foreign key constraint "enumtest_bogus_child_parent_fkey" cannot be impl DETAIL: Key columns "parent" and "id" are of incompatible types: bogus and rainbow. DROP TYPE bogus; -- +-- check transactional behaviour of ALTER TYPE ... ADD VALUE +-- +CREATE TYPE bogus AS ENUM('good'); +-- check that we can't add new values to existing enums in a transaction +BEGIN; +ALTER TYPE bogus ADD VALUE 'bad'; +ERROR: ALTER TYPE ... ADD cannot run inside a transaction block +COMMIT; +-- check that we recognize the case where the enum already existed but was +-- modified in the current txn +BEGIN; +ALTER TYPE bogus RENAME TO bogon; +ALTER TYPE bogon ADD VALUE 'bad'; +ERROR: ALTER TYPE ... ADD cannot run inside a transaction block +ROLLBACK; +DROP TYPE bogus; +-- check that we *can* add new values to existing enums in a transaction, +-- if the type is new as well +BEGIN; +CREATE TYPE bogus AS ENUM(); +ALTER TYPE bogus ADD VALUE 'good'; +ALTER TYPE bogus ADD VALUE 'ugly'; +ROLLBACK; +-- -- Cleanup -- DROP TABLE enumtest_child; |