Re: BUG #7920: Sequence rename leave stale value for sequence_name

From: Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7920: Sequence rename leave stale value for sequence_name
Date: 2013-03-06 09:55:22
Message-ID: CAK-MWwShSTdReR9RzU9Lg4e+gnYEnR_Y0ERyPdeq0gJc_Qq_Rg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>
> I don't find this particularly suprising. Nothing looks at that field in
> sequences, there imo is no point on having the name inside at all.
>
> Do you need that for some usecase or did you just happen to notice it?
>

> I personally don't see any way to nicely fix that. We can add code to
> also change the contents, but currently thats generic code. Or we could
> just remove the column in the next release?
>

Well, this story began with one very bad named sequence.
After database structure audit the developers were asked to rename this
sequence to something more appropriate.
And when they performed alter ... rename they found that the name still
same.
After that they came to me with questions.

Task is remove that very bad name from the production database altogether.
It seems that the easiest way is drop sequence and create new sequece.

+1 for "just remove the column in the next release"

--
Maxim Boguk
Senior Postgresql DBA
http://www.postgresql-consulting.ru/ <http://www.postgresql-consulting.com/>

Phone RU: +7 910 405 4718
Phone AU: +61 45 218 5678

Skype: maxim.boguk
Jabber: maxim(dot)boguk(at)gmail(dot)com
МойКруг: http://mboguk.moikrug.ru/

"People problems are solved with people.
If people cannot solve the problem, try technology.
People will then wish they'd listened at the first stage."

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2013-03-06 14:27:55 Re: BUG #7920: Sequence rename leave stale value for sequence_name
Previous Message Andres Freund 2013-03-06 09:21:01 Re: BUG #7920: Sequence rename leave stale value for sequence_name