Thread: RESET command seems pretty disjointed now
The current documentation for RESET exhibits a certain lack of, um, intellectual cohesiveness: Name RESET -- restore the value of a run-time parameter to the default value Synopsis RESET configuration_parameter RESET ALL RESET { PLANS | SESSION | TEMP | TEMPORARY } That one-line summary has got approximately zip to do with the newly added options; as does most of the Description section. At the very least this manual page needs an extensive rewrite. But I wonder whether the real problem isn't that we chose a bad name for the new commands. Is there another keyword we could use instead of RESET? A concrete objection to the current state of affairs is that absolutely anyone, looking at this set of options with no prior knowledge of PG, would expect that RESET ALL subsumes all the other cases. regards, tom lane
Tom Lane wrote: > The current documentation for RESET exhibits a certain lack of, um, > intellectual cohesiveness: > > Name > > RESET -- restore the value of a run-time parameter to the default value > > Synopsis > > RESET configuration_parameter > RESET ALL > RESET { PLANS | SESSION | TEMP | TEMPORARY } > > > That one-line summary has got approximately zip to do with the newly > added options; as does most of the Description section. At the very > least this manual page needs an extensive rewrite. But I wonder whether > the real problem isn't that we chose a bad name for the new commands. > Is there another keyword we could use instead of RESET? A concrete > objection to the current state of affairs is that absolutely anyone, > looking at this set of options with no prior knowledge of PG, would > expect that RESET ALL subsumes all the other cases. Maybe DISCARD for the plans etc might be more intuitive than extending RESET? Mark
Mark Kirkwood <markir@paradise.net.nz> writes: > Tom Lane wrote: >> The current documentation for RESET exhibits a certain lack of, um, >> intellectual cohesiveness: >> >> Synopsis >> >> RESET configuration_parameter >> RESET ALL >> RESET { PLANS | SESSION | TEMP | TEMPORARY } > Maybe DISCARD for the plans etc might be more intuitive than extending > RESET? DISCARD PLANS and DISCARD TEMP seem pretty reasonable, but DISCARD SESSION sounds a bit odd --- it seems like it might mean "disconnect", which of course is exactly what we're trying to avoid. But possibly we could rename RESET SESSION as DISCARD ALL. Leastwise I haven't got any better ideas. Anyone have another proposal? regards, tom lane
Tom Lane wrote: > Mark Kirkwood <markir@paradise.net.nz> writes: >> Tom Lane wrote: >>> The current documentation for RESET exhibits a certain lack of, um, >>> intellectual cohesiveness: >>> >>> Synopsis >>> >>> RESET configuration_parameter >>> RESET ALL >>> RESET { PLANS | SESSION | TEMP | TEMPORARY } > >> Maybe DISCARD for the plans etc might be more intuitive than extending >> RESET? > > DISCARD PLANS and DISCARD TEMP seem pretty reasonable, but DISCARD SESSION > sounds a bit odd --- it seems like it might mean "disconnect", which of > course is exactly what we're trying to avoid. But possibly we could > rename RESET SESSION as DISCARD ALL. > > Leastwise I haven't got any better ideas. Anyone have another proposal? What about RESET parameter RESET { PLANS | TEMP | TEMPORARY } RESET ALL { PARAMETERS | STATE } RESET ALL would become an abbreviation of RESET ALL PARAMETERS (for backwards compatibility), while RESET SESSION would be renamed to RESET ALL STATE. greetings, Florian Pflug
Florian Pflug <fgp.phlo.org@gmail.com> writes: > Tom Lane wrote: >>> The current documentation for RESET exhibits a certain lack of, um, >>> intellectual cohesiveness: > What about > RESET parameter > RESET { PLANS | TEMP | TEMPORARY } > RESET ALL { PARAMETERS | STATE } > RESET ALL would become an abbreviation of RESET ALL PARAMETERS (for backwards > compatibility), while RESET SESSION would be renamed to RESET ALL STATE. This doesn't do anything to address the lack of coherence. It's not only that backward compatibility forces us to break the clear meaning of ALL; another problem is that we break the symmetry between SET, RESET, and SHOW. If you can RESET SESSION, what does it mean to SET SESSION? Or SHOW SESSION? Given the precedent that RESET ALL only resets GUC variables, I think it's probably best if we just say that RESET only affects GUC variables, period. The new functionality should go by another name entirely. I'm not wedded to DISCARD by any means, but I do not believe that changing some words after RESET is going to fix my complaint. regards, tom lane
On 4/17/07, Tom Lane <tgl@sss.pgh.pa.us> wrote: > Florian Pflug <fgp.phlo.org@gmail.com> writes: > > Tom Lane wrote: > >>> The current documentation for RESET exhibits a certain lack of, um, > >>> intellectual cohesiveness: > > > What about > > RESET parameter > > RESET { PLANS | TEMP | TEMPORARY } > > RESET ALL { PARAMETERS | STATE } > > > RESET ALL would become an abbreviation of RESET ALL PARAMETERS (for backwards > > compatibility), while RESET SESSION would be renamed to RESET ALL STATE. > > This doesn't do anything to address the lack of coherence. It's not > only that backward compatibility forces us to break the clear meaning of > ALL; another problem is that we break the symmetry between SET, RESET, > and SHOW. If you can RESET SESSION, what does it mean to SET SESSION? > Or SHOW SESSION? > > Given the precedent that RESET ALL only resets GUC variables, I think > it's probably best if we just say that RESET only affects GUC variables, > period. The new functionality should go by another name entirely. > I'm not wedded to DISCARD by any means, but I do not believe that > changing some words after RESET is going to fix my complaint. Can't argue with that. Also I don't have better proposals. If DISCARD is the final word, I start to prepare a patch. -- marko
On 4/17/07, Marko Kreen <markokr@gmail.com> wrote: > If DISCARD is the final word, I start to prepare a patch. Attached patch does following conversions: RESET PLANS -> DISCARD PLANS RESET TEMP -> DISCARD TEMP RESET SESSION -> DISCARD ALL -- marko
Attachment
Tom Lane wrote: > Mark Kirkwood <markir@paradise.net.nz> writes: >> Tom Lane wrote: >>> The current documentation for RESET exhibits a certain lack of, um, >>> intellectual cohesiveness: >>> >>> Synopsis >>> >>> RESET configuration_parameter >>> RESET ALL >>> RESET { PLANS | SESSION | TEMP | TEMPORARY } > >> Maybe DISCARD for the plans etc might be more intuitive than extending >> RESET? > > DISCARD PLANS and DISCARD TEMP seem pretty reasonable, but DISCARD SESSION > sounds a bit odd --- it seems like it might mean "disconnect", which of > course is exactly what we're trying to avoid. But possibly we could > rename RESET SESSION as DISCARD ALL. > > Leastwise I haven't got any better ideas. Anyone have another proposal? What about RESET parameter RESET { PLANS | TEMP | TEMPORARY } RESET ALL { PARAMETERS | STATE } RESET ALL would become an abbreviation of RESET ALL PARAMETERS (for backwards compatibility), while RESET SESSION would be renamed to RESET ALL STATE. greetings, Florian Pflug
On Tue, 2007-04-17 at 16:34 +0300, Marko Kreen wrote: > Attached patch does following conversions: ISTM it would be cleaner to use an enum to identify the different variants of the DISCARD command, rather than a character string. Is guc.c still the logical place for the implementation of DISCARD? Something under backend/commands might be better, although I don't see a real obvious place for it. The psql tab completion code requires updating for the new DISCARD command. -Neil
On 4/23/07, Neil Conway <neilc@samurai.com> wrote: > On Tue, 2007-04-17 at 16:34 +0300, Marko Kreen wrote: > > Attached patch does following conversions: > > ISTM it would be cleaner to use an enum to identify the different > variants of the DISCARD command, rather than a character string. > > Is guc.c still the logical place for the implementation of DISCARD? > Something under backend/commands might be better, although I don't see a > real obvious place for it. > > The psql tab completion code requires updating for the new DISCARD > command. Attached patch addresses all 3 comments. As it will be top-level command, I put code into commands/discard.c -- marko
Attachment
On Tue, 2007-04-24 at 18:04 +0300, Marko Kreen wrote: > Attached patch addresses all 3 comments. As it will be > top-level command, I put code into commands/discard.c Applied with some minor tweaks -- thanks for the patch. I didn't bother moving the regression tests out of guc.sql, although they don't really belong there any longer. -Neil
Patch applied from Neil. --------------------------------------------------------------------------- Marko Kreen wrote: > On 4/23/07, Neil Conway <neilc@samurai.com> wrote: > > On Tue, 2007-04-17 at 16:34 +0300, Marko Kreen wrote: > > > Attached patch does following conversions: > > > > ISTM it would be cleaner to use an enum to identify the different > > variants of the DISCARD command, rather than a character string. > > > > Is guc.c still the logical place for the implementation of DISCARD? > > Something under backend/commands might be better, although I don't see a > > real obvious place for it. > > > > The psql tab completion code requires updating for the new DISCARD > > command. > > Attached patch addresses all 3 comments. As it will be > top-level command, I put code into commands/discard.c > > -- > marko [ Attachment, skipping... ] > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +