Documentation patch: change a name in a grammar rule to prevent confusion

Поиск
Список
Период
Сортировка
Искать

Documentation patch: change a name in a grammar rule to prevent confusion

От:
"Nicolas Barbier" <nicolas.barbier@gmail.com>
Дата:
Вложения:
Hello,

the following patch changes "parameter" to "gucname" in the grammar
(and later references) for the SET syntax in ALTER ROLE and ALTER
USER. The rationale for this is that on #postgresql (IRC), we observe
many people trying to change the password for a role as follows:

ALTER ROLE blah SET PASSWORD = 'password';

(the correct syntax is "ALTER ROLE blah PASSWORD 'password';")

The confusion is induced by the usage of the word "parameter" and the
name of a section called "Parameters", which then lists the possible
non-GUC parameters. This apparently makes readers think that those are
the "parameters" that can be changed with above syntax.

Nicolas

--
Nicolas Barbier
http://www.gnu.org/philosophy/no-word-attachments.html

Re: Documentation patch: change a name in a grammar rule

От:
Neil Conway <neilc@samurai.com>
Дата:
On Sat, 2006-04-15 at 01:59 +0200, Nicolas Barbier wrote:
> the following patch changes "parameter" to "gucname" in the grammar
> (and later references) for the SET syntax in ALTER ROLE and ALTER
> USER.

Wouldn't "var_name", "varname", or something similar be more clear?
"GUC" is probably not an acronym we should be exposing prominently to
the user.

-Neil


Re: Documentation patch: change a name in a grammar rule

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Neil Conway  writes:
> On Sat, 2006-04-15 at 01:59 +0200, Nicolas Barbier wrote:
>> the following patch changes "parameter" to "gucname" in the grammar
>> (and later references) for the SET syntax in ALTER ROLE and ALTER
>> USER.

> Wouldn't "var_name", "varname", or something similar be more clear?
> "GUC" is probably not an acronym we should be exposing prominently to
> the user.

s/prominently/at all/ ... I don't think the proposed patch is an
improvement, and in fact see nothing wrong with the use of "parameter"
here.  If we want to abandon "parameter" as the official documentation
term for GUC variables, then there are dozens or hundreds of changes
to be made in config.sgml, to say nothing of other files.

			regards, tom lane

Re: Documentation patch: change a name in a grammar rule to prevent confusion

От:
"Nicolas Barbier" <nicolas.barbier@gmail.com>
Дата:
Вложения:
2006/4/15, Neil Conway :

> On Sat, 2006-04-15 at 01:59 +0200, Nicolas Barbier wrote:
>
>> the following patch changes "parameter" to "gucname" in the grammar
>> (and later references) for the SET syntax in ALTER ROLE and ALTER
>> USER.
>
> Wouldn't "var_name", "varname", or something similar be more clear?
> "GUC" is probably not an acronym we should be exposing prominently to
> the user.

Indeed, that is what people on IRC also told me (after I sent it :-)).
It now uses "varname". Updated patch attached.

Nicolas

--
Nicolas Barbier
http://www.gnu.org/philosophy/no-word-attachments.html

Re: Documentation patch: change a name in a grammar rule

От:
"Nicolas Barbier" <nicolas.barbier@gmail.com>
Дата:
2006/4/15, Tom Lane :

> s/prominently/at all/ ... I don't think the proposed patch is an
> improvement, and in fact see nothing wrong with the use of "parameter"
> here.  If we want to abandon "parameter" as the official documentation
> term for GUC variables, then there are dozens or hundreds of changes
> to be made in config.sgml, to say nothing of other files.

In for example set.sgml, just "name" is used for the exact same
concept. I changed the patch so that "varname" is used, because "name"
was already in use by this specific grammar. Maybe the usage of "var"
makes it less clear indeed, for people that know that those things are
always referred to as "parameters" and never as "variables". But then,
leaving it as-is doesn't solve the apparently occuring confusion
between "parameter" the GUC and "parameter" the "parameter to the
statement", as we have had at least three people in #postgresql that
made that exact mistake.

Nicolas

--
Nicolas Barbier
http://www.gnu.org/philosophy/no-word-attachments.html

Re: Documentation patch: change a name in a grammar rule

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
Nicolas Barbier wrote:
> In for example set.sgml, just "name" is used for the exact same
> concept. I changed the patch so that "varname" is used, because
> "name" was already in use by this specific grammar. Maybe the usage
> of "var" makes it less clear indeed, for people that know that those
> things are always referred to as "parameters" and never as
> "variables".

A variable would be something that you store application data in, 
whereas a parameter is some nondata value that influences your 
calculations.  That's my recollection of how the terms are used in 
mathematics.  So parameter is decidedly the better term than variable.  
If that is confusing, make it config_param or something like that.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

Re: Documentation patch: change a name in a grammar rule

От:
"Nicolas Barbier" <nicolas.barbier@gmail.com>
Дата:
Вложения:
2006/4/17, Peter Eisentraut :

> Nicolas Barbier wrote:
>
>> In for example set.sgml, just "name" is used for the exact same
>> concept. I changed the patch so that "varname" is used, because
>> "name" was already in use by this specific grammar. Maybe the usage
>> of "var" makes it less clear indeed, for people that know that those
>> things are always referred to as "parameters" and never as
>> "variables".
>
> A variable would be something that you store application data in,
> whereas a parameter is some nondata value that influences your
> calculations.  That's my recollection of how the terms are used in
> mathematics.  So parameter is decidedly the better term than variable.
> If that is confusing, make it config_param or something like that.

Updated patch attached. We just had another person that made the
mistake, hopefully making up for the time and resources I'm depriving
you guys of :-).

Nicolas

--
Nicolas Barbier
http://www.gnu.org/philosophy/no-word-attachments.html

Re: Documentation patch: change a name in a grammar rule to

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:

Patch applied.  I also updated SET and RESET to be similar.

---------------------------------------------------------------------------

Nicolas Barbier wrote:
> 2006/4/15, Neil Conway :
> 
> > On Sat, 2006-04-15 at 01:59 +0200, Nicolas Barbier wrote:
> >
> >> the following patch changes "parameter" to "gucname" in the grammar
> >> (and later references) for the SET syntax in ALTER ROLE and ALTER
> >> USER.
> >
> > Wouldn't "var_name", "varname", or something similar be more clear?
> > "GUC" is probably not an acronym we should be exposing prominently to
> > the user.
> 
> Indeed, that is what people on IRC also told me (after I sent it :-)).
> It now uses "varname". Updated patch attached.
> 
> Nicolas
> 
> --
> Nicolas Barbier
> http://www.gnu.org/philosophy/no-word-attachments.html

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: doc/src/sgml/ref/alter_role.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/alter_role.sgml,v
retrieving revision 1.3
diff -c -c -r1.3 alter_role.sgml
*** doc/src/sgml/ref/alter_role.sgml	18 Dec 2005 02:17:16 -0000	1.3
--- doc/src/sgml/ref/alter_role.sgml	25 Apr 2006 14:45:24 -0000
***************
*** 36,43 ****
  
  ALTER ROLE name RENAME TO newname
  
! ALTER ROLE name SET parameter { TO | = } { value | DEFAULT }
! ALTER ROLE name RESET parameter
  
   
  
--- 36,43 ----
  
  ALTER ROLE name RENAME TO newname
  
! ALTER ROLE name SET varname { TO | = } { value | DEFAULT }
! ALTER ROLE name RESET varname
  
   
  
***************
*** 143,149 ****
       
  
       
!       parameter
        value
        
         
--- 143,149 ----
       
  
       
!       varname
        value
        
         
Index: doc/src/sgml/ref/alter_user.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v
retrieving revision 1.39
diff -c -c -r1.39 alter_user.sgml
*** doc/src/sgml/ref/alter_user.sgml	31 Jul 2005 17:19:17 -0000	1.39
--- doc/src/sgml/ref/alter_user.sgml	25 Apr 2006 14:45:25 -0000
***************
*** 36,43 ****
  
  ALTER USER name RENAME TO newname
  
! ALTER USER name SET parameter { TO | = } { value | DEFAULT }
! ALTER USER name RESET parameter
  
   
  
--- 36,43 ----
  
  ALTER USER name RENAME TO newname
  
! ALTER USER name SET varname { TO | = } { value | DEFAULT }
! ALTER USER name RESET varname
  
   
  
Index: doc/src/sgml/ref/reset.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/reset.sgml,v
retrieving revision 1.28
diff -c -c -r1.28 reset.sgml
*** doc/src/sgml/ref/reset.sgml	25 Apr 2006 14:11:51 -0000	1.28
--- doc/src/sgml/ref/reset.sgml	25 Apr 2006 14:45:25 -0000
***************
*** 20,26 ****
  
   
  
! RESET name
  RESET ALL
  
   
--- 20,26 ----
  
   
  
! RESET varname
  RESET ALL
  
   
***************
*** 33,39 ****
     default values.  RESET is an alternative
     spelling for
  
! SET parameter TO DEFAULT
  
     Refer to  for
     details.
--- 33,39 ----
     default values.  RESET is an alternative
     spelling for
  
! SET varname TO DEFAULT
  
     Refer to  for
     details.
***************
*** 62,68 ****
  
    
     
!     name
      
       
        The name of a run-time parameter. See 
     
!     varname
      
       
        The name of a run-time parameter. See 
  
! SET [ SESSION | LOCAL ] name { TO | = } { value | 'value' | DEFAULT }
  SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT }
  
   
--- 20,26 ----
  
   
  
! SET [ SESSION | LOCAL ] varname { TO | = } { value | 'value' | DEFAULT }
  SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT }
  
   
***************
*** 91,97 ****
     
  
     
!     name
      
       
        Name of a settable run-time parameter.  Available parameters are
--- 91,97 ----
     
  
     
!     varname
      
       
        Name of a settable run-time parameter.  Available parameters are

Re: Documentation patch: change a name in a grammar rule

От:
Bruce Momjian <pgman@candle.pha.pa.us>
Дата:

OK, updated patch calls them "configuration_paramters"s.

---------------------------------------------------------------------------

Nicolas Barbier wrote:
> 2006/4/17, Peter Eisentraut :
> 
> > Nicolas Barbier wrote:
> >
> >> In for example set.sgml, just "name" is used for the exact same
> >> concept. I changed the patch so that "varname" is used, because
> >> "name" was already in use by this specific grammar. Maybe the usage
> >> of "var" makes it less clear indeed, for people that know that those
> >> things are always referred to as "parameters" and never as
> >> "variables".
> >
> > A variable would be something that you store application data in,
> > whereas a parameter is some nondata value that influences your
> > calculations.  That's my recollection of how the terms are used in
> > mathematics.  So parameter is decidedly the better term than variable.
> > If that is confusing, make it config_param or something like that.
> 
> Updated patch attached. We just had another person that made the
> mistake, hopefully making up for the time and resources I'm depriving
> you guys of :-).
> 
> Nicolas
> 
> --
> Nicolas Barbier
> http://www.gnu.org/philosophy/no-word-attachments.html

[ Attachment, skipping... ]

> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

-- 
  Bruce Momjian   http://candle.pha.pa.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: doc/src/sgml/ref/alter_role.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/alter_role.sgml,v
retrieving revision 1.4
diff -c -c -r1.4 alter_role.sgml
*** doc/src/sgml/ref/alter_role.sgml	25 Apr 2006 14:47:29 -0000	1.4
--- doc/src/sgml/ref/alter_role.sgml	25 Apr 2006 14:55:23 -0000
***************
*** 36,43 ****
  
  ALTER ROLE name RENAME TO newname
  
! ALTER ROLE name SET varname { TO | = } { value | DEFAULT }
! ALTER ROLE name RESET varname
  
   
  
--- 36,43 ----
  
  ALTER ROLE name RENAME TO newname
  
! ALTER ROLE name SET configuration_parameter { TO | = } { value | DEFAULT }
! ALTER ROLE name RESET configuration_parameter
  
   
  
***************
*** 143,149 ****
       
  
       
!       varname
        value
        
         
--- 143,149 ----
       
  
       
!       configuration_parameter
        value
        
         
Index: doc/src/sgml/ref/alter_user.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/alter_user.sgml,v
retrieving revision 1.40
diff -c -c -r1.40 alter_user.sgml
*** doc/src/sgml/ref/alter_user.sgml	25 Apr 2006 14:47:29 -0000	1.40
--- doc/src/sgml/ref/alter_user.sgml	25 Apr 2006 14:55:23 -0000
***************
*** 36,43 ****
  
  ALTER USER name RENAME TO newname
  
! ALTER USER name SET varname { TO | = } { value | DEFAULT }
! ALTER USER name RESET varname
  
   
  
--- 36,43 ----
  
  ALTER USER name RENAME TO newname
  
! ALTER USER name SET configuration_parameter { TO | = } { value | DEFAULT }
! ALTER USER name RESET configuration_parameter
  
   
  
Index: doc/src/sgml/ref/reset.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/reset.sgml,v
retrieving revision 1.29
diff -c -c -r1.29 reset.sgml
*** doc/src/sgml/ref/reset.sgml	25 Apr 2006 14:47:29 -0000	1.29
--- doc/src/sgml/ref/reset.sgml	25 Apr 2006 14:55:23 -0000
***************
*** 20,26 ****
  
   
  
! RESET varname
  RESET ALL
  
   
--- 20,26 ----
  
   
  
! RESET configuration_parameter
  RESET ALL
  
   
***************
*** 33,39 ****
     default values.  RESET is an alternative
     spelling for
  
! SET varname TO DEFAULT
  
     Refer to  for
     details.
--- 33,39 ----
     default values.  RESET is an alternative
     spelling for
  
! SET configuration_parameter TO DEFAULT
  
     Refer to  for
     details.
***************
*** 62,68 ****
  
    
     
!     varname
      
       
        The name of a run-time parameter. See 
     
!     configuration_parameter
      
       
        The name of a run-time parameter. See 
  
! SET [ SESSION | LOCAL ] varname { TO | = } { value | 'value' | DEFAULT }
  SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT }
  
   
--- 20,26 ----
  
   
  
! SET [ SESSION | LOCAL ] configuration_parameter { TO | = } { value | 'value' | DEFAULT }
  SET [ SESSION | LOCAL ] TIME ZONE { timezone | LOCAL | DEFAULT }
  
   
***************
*** 91,97 ****
     
  
     
!     varname
      
       
        Name of a settable run-time parameter.  Available parameters are
--- 91,97 ----
     
  
     
!     configuration_parameter
      
       
        Name of a settable run-time parameter.  Available parameters are
FAQ