Re: [PATCHES] Proposed patch for sequence-renaming problems - Mailing list pgsql-hackers
From | Bruce Momjian |
---|---|
Subject | Re: [PATCHES] Proposed patch for sequence-renaming problems |
Date | |
Msg-id | 200509281610.j8SGAKd09861@candle.pha.pa.us Whole thread Raw |
In response to | Re: [PATCHES] Proposed patch for sequence-renaming problems (Tom Lane <tgl@sss.pgh.pa.us>) |
Responses |
Re: [PATCHES] Proposed patch for sequence-renaming problems
|
List | pgsql-hackers |
Tom Lane wrote: > Bruce Momjian <pgman@candle.pha.pa.us> writes: > > Just to follow up, I agree we can't totally replace all instances of > > nextval() with regclass because regclass requires a constant string, but > > I would like to have the regclass behavior with simple syntax and > > require people who want "late binding" of the sequence name to use some > > extra syntax, like ::text or something. > > That would require a considerably more invasive change, AFAICS: remove > the text-input version of nextval() and introduce an implicit coercion > from text to regclass to avoid breaking existing dumps. I'd prefer not > to mess with that during beta, because there'd be nontrivial risk of > breaking existing behaviors. Because the proposed patch just adds on > new functions and doesn't change the behavior of existing DEFAULT > clauses, I don't think it can break anything. > > However, we could certainly add the NEXT VALUE FOR syntax if that will > satisfy your concern about syntax. I am personally fine with use ::regclass internally, especially for SERIAL. It is documenting its use (and recommending it) that has me concerned. We are placing additional burdens on users --- burdens that will not exist in 8.2 when we have more time to fix it right. Is it worth telling users to use ::regclass in their code for 8.1 just to fix this, and then telling them in 8.2 it is not necessary to use this? > > The other question is whether we should be playing with this at all > > during beta. Should we just disable ALTER SCHEMA RENAME and return to > > this during 8.2? I am worried these side missions will delay our final > > release of 8.1. > > I'm prepared to argue that this is a bug fix, not only for ALTER SCHEMA > RENAME but for some very long-standing problems with renaming of > sequences. As I said before, you are seriously mistaken to consider > that disabling ALTER SCHEMA RENAME would eliminate the problem. If it was that bad, we should have fixed it during development, not during beta. The only reason it is getting attention now is because it is triggered more by a new feature we are adding, a feature we can easily remove. I know we both don't want to open up the entire TODO list for fixing during beta, especially fixing that isn't 100% complete and who's user-visible behavior will change in the next major release. Now, if we use ::regclass internally for just SERIAL, and don't document its use for sequences (or at last minimize its visibility), or we add NEXT VALUE FOR support and tell everyone to use that, that is fine with me because it is probably the best way for users to use this in defaults for all future releases. Am I correct that NEXT VALUE FOR is behavior which will be feature-complete and will be the recommended way to use sequences in defaults in all future releases? -- 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, Pennsylvania19073
pgsql-hackers by date: