Unix Technical Forum

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

This is a discussion on BUG #2073: Can't drop sequence when created via SERIAL column within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2073 Logged by: Aaron Dummer Email address: aaron@dummer.info PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 09:30 AM
Aaron Dummer
 
Posts: n/a
Default BUG #2073: Can't drop sequence when created via SERIAL column


The following bug has been logged online:

Bug reference: 2073
Logged by: Aaron Dummer
Email address: aaron@dummer.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 foo.bar 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.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 09:30 AM
Bruce Momjian
 
Posts: n/a
Default Re: BUG #2073: Can't drop sequence when created via SERIAL column

Aaron Dummer wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2073
> Logged by: Aaron Dummer
> Email address: aaron@dummer.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 foo.bar 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 | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:47 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com