pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: balazs@obiserver.hu
To: pgsql-bugs@postgresql.org
Cc: balazs@obiserver.hu
Subject: BUG #14825: enum type: unsafe use?
Date: Fri, 22 Sep 2017 18:59:04 +0000
Message-ID: <20170922185904.1448.16585@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs


view thread (48+ messages)  latest in thread

Message-ID: <20170922185904.1448.16585@wrigleys.postgresql.org>
Permalink:  ../20170922185904.1448.16585@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20170922185904.1448.16585@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: balazs@obiserver.hu
  Subject: Re: BUG #14825: enum type: unsafe use?
  In-Reply-To: <20170922185904.1448.16585@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox