Unix Technical Forum

ALTER TABLE RENAME column

This is a discussion on ALTER TABLE RENAME column within the pgsql Hackers forums, part of the PostgreSQL category; --> "Mario Weilguni" <mario.weilguni@icomedias.com> writes: > IMO this should do: > Alter sequence foo_bar_seq rename to foo_baf_seq; > Alter table ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 04-12-2008, 05:37 AM
Tom Lane
 
Posts: n/a
Default Re: ALTER TABLE RENAME column

"Mario Weilguni" <mario.weilguni@icomedias.com> writes:
> IMO this should do:
> Alter sequence foo_bar_seq rename to foo_baf_seq;
> Alter table foo alter baf set default nextval('foo_baf_seq')


No, it should not, because that risks breaking other references to the
sequence (eg, in user-written functions). If the user is feeling that
he wants consistency, he can rename the sequence himself and take
responsibility for any side-effects on his code.

regards, tom lane

---------------------------(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
  #12 (permalink)  
Old 04-12-2008, 05:37 AM
Jonah H. Harris
 
Posts: n/a
Default Re: ALTER TABLE RENAME column

On 11/17/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> No, it should not, because that risks breaking other references to the
> sequence (eg, in user-written functions). If the user is feeling that
> he wants consistency, he can rename the sequence himself and take
> responsibility for any side-effects on his code.


I concur.

--
Jonah H. Harris, Software Architect | phone: 732.331.1300
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 2nd Floor | jharris@enterprisedb.com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/

---------------------------(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
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 04:41 PM.


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