Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Guillaume 'ioguix' de Rorthais <ioguix(at)free(dot)fr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field
Date: 2007-10-03 17:25:57
Message-ID: 4703D0A5.4080203@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Guillaume 'ioguix' de Rorthais wrote:
> Heikki Linnakangas a écrit :
>> Tom Lane wrote:
>>> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
>>>> I am amused by the fact that we store the sequence name in the sequence
>>>> itself though.
>>> Yeah, it's a bit pointless. One possible response to this gripe would
>>> be to take the name out of the sequence itself. However, that would
>>> likely break client-side code for no very good reason.
> Actually, there's at least one reason : client side code using this value is buggy when a sequence is renamed.
> That's exactly how I found this issue: when coding "alter sequence" stuff in ppa which was using it...
> Presently, I will not use this value anymore, but I think other dev / projects which are using it should be inform about
> this issue.
> However, I don't know if breaking client side code is the solution neither.

Well, the way it is now is just broken, so IMO we have to either fix it
or remove it altogether.

Since having sequence_name in there doesn't let you do anything you
can't do without it, and there's no easy way to fix it, I'd say let's
just remove it in 8.3 and do nothing in backbranches.

>> Would it be possible to create a SELECT rule on the sequence that
>> returns the sequence name from the catalog instead?
>>
> Well it looks a pretty good idea to me, but I'm not really aware about internal constraints to judge :S

I looked at it briefly. Unfortunately you can't just use CREATE RULE to
create one, that throws an error. I believe we could change the code to
allow it, and create such a rule automatically in DefineSequence, but
frankly it doesn't seem worth the trouble to me. Doesn't seem like a
candidate for backporting anyway.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-10-03 17:33:58 Re: BUG #3619: Renaming sequence does not update its 'sequence_name' field
Previous Message Alvaro Herrera 2007-10-03 12:52:23 Re: BUG #3648: Server crashes when trying to create a table