Guillaume 'ioguix' de Rorthais wrote:
> Heikki Linnakangas a écrit :
>> Tom Lane wrote:
>>> Alvaro Herrera <alvherre@commandprompt.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