RESET command seems pretty disjointed now

Started by Tom Laneover 18 years ago12 messages
#1Tom Lane
tgl@sss.pgh.pa.us

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

#2Mark Kirkwood
markir@paradise.net.nz
In reply to: Tom Lane (#1)
Re: RESET command seems pretty disjointed now

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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Mark Kirkwood (#2)
Re: RESET command seems pretty disjointed now

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

#4Florian Pflug
fgp.phlo.org@gmail.com
In reply to: Tom Lane (#3)
Re: RESET command seems pretty disjointed now

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

#5Florian G. Pflug
fgp@phlo.org
In reply to: Tom Lane (#3)
Re: RESET command seems pretty disjointed now

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

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Florian Pflug (#4)
Re: RESET command seems pretty disjointed now

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

#7Marko Kreen
markokr@gmail.com
In reply to: Tom Lane (#6)
Re: RESET command seems pretty disjointed now

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

#8Marko Kreen
markokr@gmail.com
In reply to: Marko Kreen (#7)
1 attachment(s)
Re: RESET command seems pretty disjointed now

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

Attachments:

discard.diff.gzapplication/x-gzip; name=discard.diff.gzDownload
���$Fdiscard.diff�<�s���?��b��z������[,(	w8�����r�b�U�'�$��u��4��q���Q6�����t��t�F���zB����Y)�<���?_8�^fv`���5���98>>&��-����J�FQ/����'��uQ~�+�>�u}7�r�b���z�AJ��r��ZKa������S$�*i%����W��v�e����������D��hA��m��*]?�o�	���#���!4���I�=�bV����
I����C���}��llL���B�m�|��k���I�t��9�d�Q$1`]�f���B�$�5tf�&�p&ha= �^F��������������'�������Pf�.B���s��C�.�{(\�����z$�#�1�3
�\o����,cA�!�H��'����L�:5�G�2�����YP��9� ���VX4sIui`���M!����U o,o�0�Y2�3b�.��$
�����C��&��i�E�E�"�1Cb��!2�Nv���7�PwF�kP5���xp�8����D@����&�y���X>���b+�}P�s��8�� �#���-���K�t�MH@^k(��9�[;����d�&f1���lF�;��L?�����fY���+�k��5}y��AC!leMd��o��s����|S�0��x��@MH�|�{�3�VZ�Mau6�OR��#�6V�A(��	���S'���)�O�����H�U=��rc�U�H��5�*`��B�(��9�������Xl���Z��������l���
	�'��p@���q���S,u�w�����}�+��;��!!��p.��dj���b��R�\�� �����8�:w^�/�k�=-�M����h��T���%&	}P[��M�\9��YZ������X��re�r�=l�
e2=�EV����b�����;���9;���������N=�3*�{�����1W��I���`nuW����TJ;����V�'>+�g��n�����`����Op*� �I���T?�A�A�$�XUf'���>J'��}^)}����G��W���=����;A��)�6���A�5 ���nS7�g�9�[\';���`�i��Z���
o������Z������8�X0��-��������Q{�>7����~m�#�E]�K�l�)��%������[���m+��')W�d��/�I�Z���'�qg^���3�|����O&K���VmJ�( [3S�4f�������NDq;��bd��g�	�/^������R��i��&���W,<>�*B1�����1��_{>�C��rzV�[N!l�����()D7�����7l�6���c>�����}2UL
�&]*�����3�8�mI}}f����(C����5�NdN(%o����FUKZ56���tdo��M8����
n�B�	o�4���i`��2�hh�N@<�K)���mhl���D�������$��S����2	�x;��=�	l\��	�	szh*!��	�L��L�i���f�qe��ZM��,�k��R���]
�J�C���2�q���������W�?���'��MR�w��;N������@��O1��f ���@�3�zB�%��}-��=���=E�Ay�A��><Z�$#�p����}�&E�F������2C�F>r�i|5KG!3����k��f��{"(��>c��w���T����I�5���I�CX��1*?�)��x;�T�l��s�����"�_��g�
�7�A���w��k���#��C>Xl��{�[Y�k��8�^�J�|F�K\�F�cL
���i�E���I��1�/�2�O5��������T���%�3�������s�����d:�
�_���ns|q�*����2 XP�a��-�d	A� �p��j��]�DL$���J���W-�l��BP�s6g��;��]��1&3�	���@�a����3Ny�+ �3N7��0���W��"�^)����Ib&�2��wu�>k:��<�1�`}nC��-U
�Ti��3��7?��%����\�l��������*^�����=6�_a�%��Ujx"��j��+��#(��:64f��J���WS1s�r	@��##���j�)\=n5��J��g9n@�[�#8D��Y����K15�^�p+��`����U��r����;sa;wLG��5)o4�s/XV:N [�J�	�C-%�i�)(��+T[��T+���p/b�+V��NX'�����[t���1R~�{��WBi��`FX)+@@<}VJaR���xXG���%5r&M<S,�I!��
1�B�k���
����R!����IW���J:�?k��JS}>�������|w��.Gjh�5:��;o�YE������u�p�����[�U���������oL
���;�M9��MP~]c��S��A��t`�!�u.������vo�n.D��p$�`�;���I��t�]�0�f�i4��A�U\��e�i���?;�h���6g��0����F�b�W j�Q��+�>h��f��L��+X�<�;��z�Wdq���R]����kn���������{�	��d8���'2��t8����Y�q8�`��1^7���h"n���L�����i�'��C~R��\
'=D��Gc6K��0�3���
�u�
����O�y����{}��1��a��^�qqk������������>/2�[Z����PK�����-#��;G���W��� (��Pi�UX��l��*E{*55���(*��p��L.aJ������T�6��)?Z����-�}�����d
k��g8A�C�qc�/�(����q%�G,m������I��������0ex:"�����9�=�
`��� �����?d�����7��$�K���<�/��� 3��h��f�XR��M���H5��&1D:+��c� �p!)sG!��f�j��y��5[�J�T�����H�"�O$�\�d%�.V�]�������������%��6�S��������Z��R6$'�r����������(�MV��tb�`��P�mP�JT��J4�wJ��v���0O5��8L�����
���0����+PnPW��m�lB�8K�����+d\�������{<rz��i\c��^`��@�p��*�Zv ����Tq�W��C��-oY�Bv��9T:=�^������jU�VKQf��by~������������6�t�����������i^�u������[����G*�����?E*Ad>�����J�D�F#=��t������A3�A�V�J�z%�*��!q���fr��zr�70.�*�>���&���2}�Z,��_��P�t8<"o�������9:�'��b�9�4��l���6���7J�|g�0����"�M��bfJ�$7��ND8�y��}(�!��=�������ae��v��o�l����n���f)(����yd=�a]q/�z���k��(i������%��&O��������n=����n����P>�*��0�&��a���c��'|K��G��`�|u~����P2���!KO~�c���������� C����1Wh	��`_{�i�*�'3�5�^ 	=b��uC@!���j��1v �8#~��M�C"	���2�P�����n8M�wnL��'��V���4m��K���6������?M��z}�\�������v�!?��(�X��#O�<P�����������d�I��/�u��	Z�m�Z�E-%�d����1\S�9�#��$��y�H9���J�7����A� �c���)�89��ke�W��o��7l��[j�m��rU��Ze��x��\P!e��������-`m)~e������N���X���������9R3��"��;��#[�C��Cg�O���L�!>d�]��).�K��l�n2���5��.��(��S��b�`~��,�����q������M��U��n������ �8�9�����|k�s����qu'WX��8��������BF��fp���������M�	����������d�G:���c`����������R;a��li�����+H��$>���P[��x_2�q0��K�Q�L����)�?�������~������������n�,i|W�R�j�^��&�S����Y���m�m���8xK��,�[��G����������9�P�2_��.{�Z�g��;��U6�������*��-�r�E��M���4Ll/���gw�j5�r��h�O��[p�4��4�0��{R��
�E�v��R����e���78���^���%t�F��"
��9Qu���"��bH��(���c����%�D��dKNl���A8�����cX���b-q[�4X��"|
�Q����|:��'-��KjA���������[�}�B?���U��U+��|������n��/2�����x
!���G���������%J��&!H��������7G��x�q���@�3�wJ���w��9����~���16����e���HT��:�L}�\����LiT��L~@!(=�����"����c�� _���������=T�<\����3wyj���H�b<����������AIP]�s�{�������g�v���{�4[Z���o�X�]�s.�X�<N9=��}&�����,�/XR?�&
A��F��i�g
��|3�����	����@�>�%WF���oA��C5|�Fj�`�K@W��M�T�'��I����$�0��X���+��'5s;������Yp������������_q���������C[Q���� ��Q������K��rC}�R.��`�_*=������M�	�6|Vb,�	W4I��s$�� �I�S�J������?�������u�D�Y
#9Neil Conway
neilc@samurai.com
In reply to: Marko Kreen (#8)
Re: RESET command seems pretty disjointed now

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

#10Marko Kreen
markokr@gmail.com
In reply to: Neil Conway (#9)
1 attachment(s)
Re: RESET command seems pretty disjointed now

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

Attachments:

discard_v2.diff.gzapplication/x-gzip; name=discard_v2.diff.gzDownload
#11Bruce Momjian
bruce@momjian.us
In reply to: Marko Kreen (#10)
Re: RESET command seems pretty disjointed now

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. +

#12Neil Conway
neilc@samurai.com
In reply to: Marko Kreen (#10)
Re: RESET command seems pretty disjointed now

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