Skip site navigation (1) Skip section navigation (2)

Patch for BUG #2073: Can't drop sequence when created via SERIAL column

From: Dhanaraj M <Dhanaraj(dot)M(at)Sun(dot)COM>
To: pgsql-patches(at)postgresql(dot)org
Subject: Patch for BUG #2073: Can't drop sequence when created via SERIAL column
Date: 2006-04-26 08:53:32
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches

I send the appropriate patch for bug #2073. This fix disallows to change the default sequence.
I ran the regression test and passed. The bug details are given below. 
I am awaiting to answer for any further clarifications.

> Bug reference:      2073
> Logged by:          Aaron Dummer
> Email address:      aaron ( at ) dummer ( dot ) info
> PostgreSQL version: 8.0.3
> Operating system:   Debian Linux
> Description:        Can't drop sequence when created via SERIAL column
> Details: 
> If I create a table named foo with a column named bar, column type SERIAL,
> it auto-generates a sequence named foo_bar_seq.  Now if I manually create a
> new sequence called custom_seq, and change the default value of to
> reference the new sequence, I still can't delete the old sequence
> (foo_bar_seq).
> In other words, from a user's point of view, the foo table is no longer
> dependent on the foo_bar_seq, yet the system still sees it as dependent.
> I brought this topic up on the #postgresql IRC channel and the behavior was
> confirmed by AndrewSN, scampbell_, and mastermind.

Right.  We have this TODO item:

	* %Disallow changing default expression of a SERIAL column?

which would prevent you from changing the default expression for a
SERIAL column.  So the answer is, don't do that, and in the future, we
might prevent it.

  Bruce Momjian       


Attachment: 2073_defaultSeq.patch
Description: text/x-patch (6.0 KB)


pgsql-patches by date

Next:From: Gevik BabakhaniDate: 2006-04-26 14:23:25
Subject: Patch for %Allow per-database permissions to be set via GRANT
Previous:From: Bruce MomjianDate: 2006-04-26 02:18:41
Subject: Re: [HACKERS] For Review: Allow WAL information to recover corrupted

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group