Re: [PATCHES] Documentation patch: change a name in a grammar rule

2006-04-17 Thread Nicolas Barbier
2006/4/17, Peter Eisentraut <[EMAIL PROTECTED]>:

> 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
*** ./doc/src/sgml/ref/alter_role.sgml.orig	2006-04-15 01:15:51.0 +0200
--- ./doc/src/sgml/ref/alter_role.sgml	2006-04-17 23:39:35.0 +0200
***
*** 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 config_param { TO | = } { value | DEFAULT }
! ALTER ROLE name RESET config_param
  
   
  
***
*** 143,149 
   
  
   
!   parameter
value

 
--- 143,149 
   
  
   
!   config_param
value

 
*** ./doc/src/sgml/ref/alter_user.sgml.orig	2006-04-15 01:15:51.0 +0200
--- ./doc/src/sgml/ref/alter_user.sgml	2006-04-17 23:39:50.0 +0200
***
*** 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 config_param { TO | = } { value | DEFAULT }
! ALTER USER name RESET config_param
  
   
  

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


Re: [PATCHES] Documentation patch: change a name in a grammar rule

2006-04-15 Thread Nicolas Barbier
2006/4/15, Tom Lane <[EMAIL PROTECTED]>:

> 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

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


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

2006-04-15 Thread Nicolas Barbier
2006/4/15, Neil Conway <[EMAIL PROTECTED]>:

> 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
*** ./doc/src/sgml/ref/alter_role.sgml.orig	2006-04-15 01:15:51.0 +0200
--- ./doc/src/sgml/ref/alter_role.sgml	2006-04-15 16:24:49.0 +0200
***
*** 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

 
*** ./doc/src/sgml/ref/alter_user.sgml.orig	2006-04-15 01:15:51.0 +0200
--- ./doc/src/sgml/ref/alter_user.sgml	2006-04-15 16:25:00.0 +0200
***
*** 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
  
   
  




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


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

2006-04-14 Thread Nicolas Barbier
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
*** ./doc/src/sgml/ref/alter_role.sgml.orig	2006-04-15 01:15:51.0 +0200
--- ./doc/src/sgml/ref/alter_role.sgml	2006-04-15 01:16:02.0 +0200
***
*** 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 gucname { TO | = } { value | DEFAULT }
! ALTER ROLE name RESET gucname
  
   
  
***
*** 143,149 
   
  
   
!   parameter
value

 
--- 143,149 
   
  
   
!   gucname
value

 
*** ./doc/src/sgml/ref/alter_user.sgml.orig	2006-04-15 01:15:51.0 +0200
--- ./doc/src/sgml/ref/alter_user.sgml	2006-04-15 01:16:02.0 +0200
***
*** 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 gucname { TO | = } { value | DEFAULT }
! ALTER USER name RESET gucname
  
   
  




---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [PATCHES] Patch to allow contrib/pgbench files to have blank lines

2005-12-07 Thread Nicolas Barbier
On 11/23/05, David Fetter <[EMAIL PROTECTED]> wrote:

> Having blank lines in -f scripts was causing silent failures.  This
> fixes it, for some value of "fixes."  If it's OK, please apply to 8.1
> CURRENT and CVS TIP :)

> if (strncmp(buf, "\n", 1) != 0) {
> commands = process_commands(buf);
> if (commands == NULL)
> {
> fclose(fd);
> return false;
> }
> } else {
> lineno++;

Above line will cause a skip in the my_commands array, leaving a
garbage pointer. Removing it will fix things.

> continue;
> }
>
> my_commands[lineno] = commands;

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

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org