BUG #3925: You can delete enum elements from pg_enum, but it is used in a table

Lists: pgsql-bugs
From: "Stefan Kunick" <stefan(at)kunick(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3925: You can delete enum elements from pg_enum, but it is used in a table
Date: 2008-02-02 19:20:48
Message-ID: 200802021920.m12JKmZC006493@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3925
Logged by: Stefan Kunick
Email address: stefan(at)kunick(dot)org
PostgreSQL version: 8.3RC2
Operating system: Windows Longhorn
Description: You can delete enum elements from pg_enum, but it is
used in a table
Details:

I create a enumeration. After this, i used the enumeration in a table. I
delete the enumeration in the table pg_enum (delete from pg_enum where
enumtypid=16631 and enumlabel='center'; The delete don't check, that the
element is used in a table.

When you access to the table some programs stopped with a error.

Can we check in the delete statement that the element ist used in a table?


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Stefan Kunick" <stefan(at)kunick(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3925: You can delete enum elements from pg_enum, but it is used in a table
Date: 2008-02-02 20:40:15
Message-ID: 10071.1201984815@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

"Stefan Kunick" <stefan(at)kunick(dot)org> writes:
> I create a enumeration. After this, i used the enumeration in a table. I
> delete the enumeration in the table pg_enum (delete from pg_enum where
> enumtypid=16631 and enumlabel='center'; The delete don't check, that the
> element is used in a table.

Manual modifications of the system catalogs are not supported. If you
choose to do that, it's on your own head whether the results are sane.

regards, tom lane