From: Tom Lane <tgl@sss.pgh.pa.us>
To: Craig Ringer <ringerc@ringerc.id.au>
Cc: phb.emaj@free.fr
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6683: dropping a table with a serial column from an extension needs to explicitely drop the associated seq
Date: Sun, 10 Jun 2012 08:57:12 -0400
Message-ID: <14871.1339333032@sss.pgh.pa.us> (raw)
In-Reply-To: <4FD41860.5030200@ringerc.id.au>
References: <E1SdFkp-0006cC-Bn@wrigleys.postgresql.org>
<5280.1339280042@sss.pgh.pa.us>
<4FD41860.5030200@ringerc.id.au>
Craig Ringer <ringerc@ringerc.id.au> writes:
> On 06/10/2012 06:14 AM, Tom Lane wrote:
>> phb.emaj@free.fr writes:
>>> When a table having a seial column has been created by a CREATE EXTENSION,
>>> and when this table is later dropped from the extension, the associated
>>> sequence must be also explicitely dropped from the extension.
>> This doesn't really seem like a bug to me. The sequence is a somewhat
>> independent object.
> I disagree; it is inconsistent with the expectation established in
> normal operations that the sequence created to serve a SERIAL column is
> owned by that table/column and is dropped when it is.
But we're not talking about a DROP; we're talking about disassociating
it from an extension. That's a sufficiently unusual thing to do that
I think it dangerous to make any assumptions about why the extension
author is doing that, or whether he wants the sequence to come too.
In the reverse direction, ALTER EXTENSION ADD TABLE doesn't auto-add
associated sequences either.
If we did do something like this, pg_dump would need some complicated
and fragile logic additions to understand the implications; for
instance, if it saw an owned sequence that wasn't a member of the
extension, it would have to know to issue an ALTER EXTENSION DROP
SEQUENCE after adding the table. (Now admittedly, I'm on record as
wanting to get rid of pg_dump having to do anything with extension
members, but still it's a great example of why "helpful" automatic
actions aren't necessarily a good thing.)
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, ringerc@ringerc.id.au, phb.emaj@free.fr
Subject: Re: BUG #6683: dropping a table with a serial column from an extension needs to explicitely drop the associated seq
In-Reply-To: <14871.1339333032@sss.pgh.pa.us>
References: <E1SdFkp-0006cC-Bn@wrigleys.postgresql.org> <5280.1339280042@sss.pgh.pa.us> <4FD41860.5030200@ringerc.id.au> <14871.1339333032@sss.pgh.pa.us>
* 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