Thread: Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:
Hello

third version with Erik's update

Thanks Erik

Regards

Pavel


2014-06-22 12:01 GMT+02:00 Erik Rijkers <er@xs4all.nl>:
Hi Pavel,

It seems you overlooked the patch that I sent?

There are some typo's in your patch (also in v2) like:

PROPMPT1, PROPMT2, PROPMPT3

SIGLELINE

I fixed those in my patch and improved the text.
Attached is the diff against your v1 patch


Thanks,


Erik








---------------------------------------------------- Original Message -----------------------------------------------------
Subject: Re: [HACKERS] proposal: new long psql parameter --on-error-stop
From:    "Erik Rijkers" <er@xs4all.nl>
Date:    Sun, June 22, 2014 01:33
To:      "Pavel Stehule" <pavel.stehule@gmail.com>
Cc:      "MauMau" <maumau307@gmail.com>
         "Andrew Dunstan" <andrew@dunslane.net>
         "Tom Lane" <tgl@sss.pgh.pa.us>
         Fabrízio Mello <fabriziomello@gmail.com>
         "PostgreSQL Hackers" <pgsql-hackers@postgresql.org>
---------------------------------------------------------------------------------------------------------------------------

On Sun, June 22, 2014 00:10, Pavel Stehule wrote:

> [help-variables-01.patch ]

+1.  This patch is a very useful improvement, IMHO.

I edited the text somewhat; and removed some obvious typos.

thanks,

Erik Rijkers
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Fujii Masao
Date:
On Mon, Jun 23, 2014 at 12:04 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
> third version with Erik's update

Here are some my comments:

The document of psql needs to be updated. At least the description of new option
this patch adds needs to be added into the document.

+    printf(_("  --help-variables         list of available
configuration variables (options), then exit\n"));

We should get rid of "of" from the message, or add "show" in front of "list of"?

+    printf(_("  ECHO               write all input lines to standard
output\n"));

This message seems not to be correct when ECHO=queries is set.

+    printf(_("  COMP_KEYWORD_CASE  determines which letter case to
use when completing an SQL key word\n"));
+    printf(_("  DBNAME             name of currently connected database\n"));
+    printf(_("  ECHO               write all input lines to standard
output\n"));

I found that some help message line uses a normal form of a verb, but
other does not.
We should standardize them?

+    printf(_("  PROMPT1, PROMPT2, PROMPT3  specify the psql prompt\n"));

When the option name field is long, we should add a new line just
after the name field
and align the starting position of the option explanation field. That is,
for example, the above should be

printf(_("  PROMPT1, PROMPT2, PROMPT3\n"            "                     specify the psql prompt\n"));

+    printf(_("  ON_ERROR_ROLLBACK  when on, ROLLBACK on error\n"));

This message seems incorrect to me. When this option is on and an error occurs
in transaction, transaction continues rather than ROLLBACK occurs, IIUC.
I did not check whole help messages yet, but ISTM some messages are not correct.
It's better to check them again.

+    printf(_("  PSQL_RC            alternative location of the user's
.psqlrc file\n"));

Typo: PSQL_RC should be PSQLRC

+    printf(_("  PGDATABASE         same as the dbname connection
parameter\n"));
+    printf(_("  PGHOST             same as the host connection parameter\n"));
+        printf(_("  PGPORT             same as the port connection
parameter\n"));
+    printf(_("  PGUSER             same as the user connection parameter\n"));
+    printf(_("  PGPASSWORD         possibility to set password (not
recommended)\n"));
+    printf(_("  PGPASSFILE         password file (default ~/.pgpass)\n"));

I don't think that psql needs to display the help messages of even environment
variables supported by libpq.

Regards,

-- 
Fujii Masao



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:
Hello


2014-06-23 10:02 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
On Mon, Jun 23, 2014 at 12:04 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
> third version with Erik's update

Here are some my comments:

The document of psql needs to be updated. At least the description of new option
this patch adds needs to be added into the document.

+    printf(_("  --help-variables         list of available
configuration variables (options), then exit\n"));

We should get rid of "of" from the message, or add "show" in front of "list of"?

+    printf(_("  ECHO               write all input lines to standard
output\n"));

This message seems not to be correct when ECHO=queries is set.

+    printf(_("  COMP_KEYWORD_CASE  determines which letter case to
use when completing an SQL key word\n"));
+    printf(_("  DBNAME             name of currently connected database\n"));
+    printf(_("  ECHO               write all input lines to standard
output\n"));

I found that some help message line uses a normal form of a verb, but
other does not.
We should standardize them?

+    printf(_("  PROMPT1, PROMPT2, PROMPT3  specify the psql prompt\n"));

When the option name field is long, we should add a new line just
after the name field
and align the starting position of the option explanation field. That is,
for example, the above should be

printf(_("  PROMPT1, PROMPT2, PROMPT3\n"
             "                     specify the psql prompt\n"));

+    printf(_("  ON_ERROR_ROLLBACK  when on, ROLLBACK on error\n"));

This message seems incorrect to me. When this option is on and an error occurs
in transaction, transaction continues rather than ROLLBACK occurs, IIUC.
I did not check whole help messages yet, but ISTM some messages are not correct.
It's better to check them again.

+    printf(_("  PSQL_RC            alternative location of the user's
.psqlrc file\n"));

Typo: PSQL_RC should be PSQLRC

+    printf(_("  PGDATABASE         same as the dbname connection
parameter\n"));
+    printf(_("  PGHOST             same as the host connection parameter\n"));
+        printf(_("  PGPORT             same as the port connection
parameter\n"));
+    printf(_("  PGUSER             same as the user connection parameter\n"));
+    printf(_("  PGPASSWORD         possibility to set password (not
recommended)\n"));
+    printf(_("  PGPASSFILE         password file (default ~/.pgpass)\n"));

I don't think that psql needs to display the help messages of even environment
variables supported by libpq.


Main reason is a PGPASSWORD -- it is probably most used env variable with psql

PGPASSWORD=****** psql is very often used pattern

Regards

Pavel Stehule
 
Regards,

--
Fujii Masao

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Fujii Masao
Date:
On Mon, Jun 23, 2014 at 5:10 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
>
> 2014-06-23 10:02 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
>
>> On Mon, Jun 23, 2014 at 12:04 AM, Pavel Stehule <pavel.stehule@gmail.com>
>> wrote:
>> > Hello
>> >
>> > third version with Erik's update
>>
>> Here are some my comments:
>>
>> The document of psql needs to be updated. At least the description of new
>> option
>> this patch adds needs to be added into the document.
>>
>> +    printf(_("  --help-variables         list of available
>> configuration variables (options), then exit\n"));
>>
>> We should get rid of "of" from the message, or add "show" in front of
>> "list of"?
>>
>> +    printf(_("  ECHO               write all input lines to standard
>> output\n"));
>>
>> This message seems not to be correct when ECHO=queries is set.
>>
>> +    printf(_("  COMP_KEYWORD_CASE  determines which letter case to
>> use when completing an SQL key word\n"));
>> +    printf(_("  DBNAME             name of currently connected
>> database\n"));
>> +    printf(_("  ECHO               write all input lines to standard
>> output\n"));
>>
>> I found that some help message line uses a normal form of a verb, but
>> other does not.
>> We should standardize them?
>>
>> +    printf(_("  PROMPT1, PROMPT2, PROMPT3  specify the psql prompt\n"));
>>
>> When the option name field is long, we should add a new line just
>> after the name field
>> and align the starting position of the option explanation field. That is,
>> for example, the above should be
>>
>> printf(_("  PROMPT1, PROMPT2, PROMPT3\n"
>>              "                     specify the psql prompt\n"));
>>
>> +    printf(_("  ON_ERROR_ROLLBACK  when on, ROLLBACK on error\n"));
>>
>> This message seems incorrect to me. When this option is on and an error
>> occurs
>> in transaction, transaction continues rather than ROLLBACK occurs, IIUC.
>> I did not check whole help messages yet, but ISTM some messages are not
>> correct.
>> It's better to check them again.
>>
>> +    printf(_("  PSQL_RC            alternative location of the user's
>> .psqlrc file\n"));
>>
>> Typo: PSQL_RC should be PSQLRC
>>
>> +    printf(_("  PGDATABASE         same as the dbname connection
>> parameter\n"));
>> +    printf(_("  PGHOST             same as the host connection
>> parameter\n"));
>> +        printf(_("  PGPORT             same as the port connection
>> parameter\n"));
>> +    printf(_("  PGUSER             same as the user connection
>> parameter\n"));
>> +    printf(_("  PGPASSWORD         possibility to set password (not
>> recommended)\n"));
>> +    printf(_("  PGPASSFILE         password file (default
>> ~/.pgpass)\n"));
>>
>> I don't think that psql needs to display the help messages of even
>> environment
>> variables supported by libpq.
>>
>
> Main reason is a PGPASSWORD -- it is probably most used env variable with
> psql
>
> PGPASSWORD=****** psql is very often used pattern

But it's not recommended as the help message which the patch added says ;)

Regards,

-- 
Fujii Masao



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:



2014-06-23 10:57 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
On Mon, Jun 23, 2014 at 5:10 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
>
> 2014-06-23 10:02 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
>
>> On Mon, Jun 23, 2014 at 12:04 AM, Pavel Stehule <pavel.stehule@gmail.com>
>> wrote:
>> > Hello
>> >
>> > third version with Erik's update
>>
>> Here are some my comments:
>>
>> The document of psql needs to be updated. At least the description of new
>> option
>> this patch adds needs to be added into the document.
>>
>> +    printf(_("  --help-variables         list of available
>> configuration variables (options), then exit\n"));
>>
>> We should get rid of "of" from the message, or add "show" in front of
>> "list of"?
>>
>> +    printf(_("  ECHO               write all input lines to standard
>> output\n"));
>>
>> This message seems not to be correct when ECHO=queries is set.
>>
>> +    printf(_("  COMP_KEYWORD_CASE  determines which letter case to
>> use when completing an SQL key word\n"));
>> +    printf(_("  DBNAME             name of currently connected
>> database\n"));
>> +    printf(_("  ECHO               write all input lines to standard
>> output\n"));
>>
>> I found that some help message line uses a normal form of a verb, but
>> other does not.
>> We should standardize them?
>>
>> +    printf(_("  PROMPT1, PROMPT2, PROMPT3  specify the psql prompt\n"));
>>
>> When the option name field is long, we should add a new line just
>> after the name field
>> and align the starting position of the option explanation field. That is,
>> for example, the above should be
>>
>> printf(_("  PROMPT1, PROMPT2, PROMPT3\n"
>>              "                     specify the psql prompt\n"));
>>
>> +    printf(_("  ON_ERROR_ROLLBACK  when on, ROLLBACK on error\n"));
>>
>> This message seems incorrect to me. When this option is on and an error
>> occurs
>> in transaction, transaction continues rather than ROLLBACK occurs, IIUC.
>> I did not check whole help messages yet, but ISTM some messages are not
>> correct.
>> It's better to check them again.
>>
>> +    printf(_("  PSQL_RC            alternative location of the user's
>> .psqlrc file\n"));
>>
>> Typo: PSQL_RC should be PSQLRC
>>
>> +    printf(_("  PGDATABASE         same as the dbname connection
>> parameter\n"));
>> +    printf(_("  PGHOST             same as the host connection
>> parameter\n"));
>> +        printf(_("  PGPORT             same as the port connection
>> parameter\n"));
>> +    printf(_("  PGUSER             same as the user connection
>> parameter\n"));
>> +    printf(_("  PGPASSWORD         possibility to set password (not
>> recommended)\n"));
>> +    printf(_("  PGPASSFILE         password file (default
>> ~/.pgpass)\n"));
>>
>> I don't think that psql needs to display the help messages of even
>> environment
>> variables supported by libpq.
>>
>
> Main reason is a PGPASSWORD -- it is probably most used env variable with
> psql
>
> PGPASSWORD=****** psql is very often used pattern

But it's not recommended as the help message which the patch added says ;)

why?

who can see this value?

regards

Pavel
 

Regards,

--
Fujii Masao

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Fujii Masao
Date:
On Mon, Jun 23, 2014 at 6:06 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
>
>
> 2014-06-23 10:57 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
>
>> On Mon, Jun 23, 2014 at 5:10 PM, Pavel Stehule <pavel.stehule@gmail.com>
>> wrote:
>> > Hello
>> >
>> >
>> > 2014-06-23 10:02 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
>> >
>> >> On Mon, Jun 23, 2014 at 12:04 AM, Pavel Stehule
>> >> <pavel.stehule@gmail.com>
>> >> wrote:
>> >> > Hello
>> >> >
>> >> > third version with Erik's update
>> >>
>> >> Here are some my comments:
>> >>
>> >> The document of psql needs to be updated. At least the description of
>> >> new
>> >> option
>> >> this patch adds needs to be added into the document.
>> >>
>> >> +    printf(_("  --help-variables         list of available
>> >> configuration variables (options), then exit\n"));
>> >>
>> >> We should get rid of "of" from the message, or add "show" in front of
>> >> "list of"?
>> >>
>> >> +    printf(_("  ECHO               write all input lines to standard
>> >> output\n"));
>> >>
>> >> This message seems not to be correct when ECHO=queries is set.
>> >>
>> >> +    printf(_("  COMP_KEYWORD_CASE  determines which letter case to
>> >> use when completing an SQL key word\n"));
>> >> +    printf(_("  DBNAME             name of currently connected
>> >> database\n"));
>> >> +    printf(_("  ECHO               write all input lines to standard
>> >> output\n"));
>> >>
>> >> I found that some help message line uses a normal form of a verb, but
>> >> other does not.
>> >> We should standardize them?
>> >>
>> >> +    printf(_("  PROMPT1, PROMPT2, PROMPT3  specify the psql
>> >> prompt\n"));
>> >>
>> >> When the option name field is long, we should add a new line just
>> >> after the name field
>> >> and align the starting position of the option explanation field. That
>> >> is,
>> >> for example, the above should be
>> >>
>> >> printf(_("  PROMPT1, PROMPT2, PROMPT3\n"
>> >>              "                     specify the psql prompt\n"));
>> >>
>> >> +    printf(_("  ON_ERROR_ROLLBACK  when on, ROLLBACK on error\n"));
>> >>
>> >> This message seems incorrect to me. When this option is on and an error
>> >> occurs
>> >> in transaction, transaction continues rather than ROLLBACK occurs,
>> >> IIUC.
>> >> I did not check whole help messages yet, but ISTM some messages are not
>> >> correct.
>> >> It's better to check them again.
>> >>
>> >> +    printf(_("  PSQL_RC            alternative location of the user's
>> >> .psqlrc file\n"));
>> >>
>> >> Typo: PSQL_RC should be PSQLRC
>> >>
>> >> +    printf(_("  PGDATABASE         same as the dbname connection
>> >> parameter\n"));
>> >> +    printf(_("  PGHOST             same as the host connection
>> >> parameter\n"));
>> >> +        printf(_("  PGPORT             same as the port connection
>> >> parameter\n"));
>> >> +    printf(_("  PGUSER             same as the user connection
>> >> parameter\n"));
>> >> +    printf(_("  PGPASSWORD         possibility to set password (not
>> >> recommended)\n"));
>> >> +    printf(_("  PGPASSFILE         password file (default
>> >> ~/.pgpass)\n"));
>> >>
>> >> I don't think that psql needs to display the help messages of even
>> >> environment
>> >> variables supported by libpq.
>> >>
>> >
>> > Main reason is a PGPASSWORD -- it is probably most used env variable
>> > with
>> > psql
>> >
>> > PGPASSWORD=****** psql is very often used pattern
>>
>> But it's not recommended as the help message which the patch added says ;)
>
>
> why?
>
> who can see this value?

I'm sure that the document explains this.

http://www.postgresql.org/docs/devel/static/libpq-envars.html
---------------------------------------
PGPASSWORD behaves the same as the password connection parameter.
Use of this environment variable is not recommended for security reasons,
as some operating systems allow non-root users to see process environment
variables via ps; instead consider using the ~/.pgpass file
---------------------------------------

Regards,

-- 
Fujii Masao



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:



2014-06-23 11:53 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
On Mon, Jun 23, 2014 at 6:06 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
>
>
> 2014-06-23 10:57 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
>
>> On Mon, Jun 23, 2014 at 5:10 PM, Pavel Stehule <pavel.stehule@gmail.com>
>> wrote:
>> > Hello
>> >
>> >
>> > 2014-06-23 10:02 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
>> >
>> >> On Mon, Jun 23, 2014 at 12:04 AM, Pavel Stehule
>> >> <pavel.stehule@gmail.com>
>> >> wrote:
>> >> > Hello
>> >> >
>> >> > third version with Erik's update
>> >>
>> >> Here are some my comments:
>> >>
>> >> The document of psql needs to be updated. At least the description of
>> >> new
>> >> option
>> >> this patch adds needs to be added into the document.
>> >>
>> >> +    printf(_("  --help-variables         list of available
>> >> configuration variables (options), then exit\n"));
>> >>
>> >> We should get rid of "of" from the message, or add "show" in front of
>> >> "list of"?
>> >>
>> >> +    printf(_("  ECHO               write all input lines to standard
>> >> output\n"));
>> >>
>> >> This message seems not to be correct when ECHO=queries is set.
>> >>
>> >> +    printf(_("  COMP_KEYWORD_CASE  determines which letter case to
>> >> use when completing an SQL key word\n"));
>> >> +    printf(_("  DBNAME             name of currently connected
>> >> database\n"));
>> >> +    printf(_("  ECHO               write all input lines to standard
>> >> output\n"));
>> >>
>> >> I found that some help message line uses a normal form of a verb, but
>> >> other does not.
>> >> We should standardize them?
>> >>
>> >> +    printf(_("  PROMPT1, PROMPT2, PROMPT3  specify the psql
>> >> prompt\n"));
>> >>
>> >> When the option name field is long, we should add a new line just
>> >> after the name field
>> >> and align the starting position of the option explanation field. That
>> >> is,
>> >> for example, the above should be
>> >>
>> >> printf(_("  PROMPT1, PROMPT2, PROMPT3\n"
>> >>              "                     specify the psql prompt\n"));
>> >>
>> >> +    printf(_("  ON_ERROR_ROLLBACK  when on, ROLLBACK on error\n"));
>> >>
>> >> This message seems incorrect to me. When this option is on and an error
>> >> occurs
>> >> in transaction, transaction continues rather than ROLLBACK occurs,
>> >> IIUC.
>> >> I did not check whole help messages yet, but ISTM some messages are not
>> >> correct.
>> >> It's better to check them again.
>> >>
>> >> +    printf(_("  PSQL_RC            alternative location of the user's
>> >> .psqlrc file\n"));
>> >>
>> >> Typo: PSQL_RC should be PSQLRC
>> >>
>> >> +    printf(_("  PGDATABASE         same as the dbname connection
>> >> parameter\n"));
>> >> +    printf(_("  PGHOST             same as the host connection
>> >> parameter\n"));
>> >> +        printf(_("  PGPORT             same as the port connection
>> >> parameter\n"));
>> >> +    printf(_("  PGUSER             same as the user connection
>> >> parameter\n"));
>> >> +    printf(_("  PGPASSWORD         possibility to set password (not
>> >> recommended)\n"));
>> >> +    printf(_("  PGPASSFILE         password file (default
>> >> ~/.pgpass)\n"));
>> >>
>> >> I don't think that psql needs to display the help messages of even
>> >> environment
>> >> variables supported by libpq.
>> >>
>> >
>> > Main reason is a PGPASSWORD -- it is probably most used env variable
>> > with
>> > psql
>> >
>> > PGPASSWORD=****** psql is very often used pattern
>>
>> But it's not recommended as the help message which the patch added says ;)
>
>
> why?
>
> who can see this value?

I'm sure that the document explains this.

ok

I am too Linux centrist :( it is safe there and I don't see a others

Thank you for info

Regards

Pavel
 

http://www.postgresql.org/docs/devel/static/libpq-envars.html
---------------------------------------
PGPASSWORD behaves the same as the password connection parameter.
Use of this environment variable is not recommended for security reasons,
as some operating systems allow non-root users to see process environment
variables via ps; instead consider using the ~/.pgpass file
---------------------------------------

Regards,

--
Fujii Masao

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:
Hello

I am sending little bit modified patch by Fujii' comments - but I am not able to fix it more - it is task for someone with better English skill then I have

Regards

Pavel


2014-06-23 10:02 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
On Mon, Jun 23, 2014 at 12:04 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
> third version with Erik's update

Here are some my comments:

The document of psql needs to be updated. At least the description of new option
this patch adds needs to be added into the document.

+    printf(_("  --help-variables         list of available
configuration variables (options), then exit\n"));

We should get rid of "of" from the message, or add "show" in front of "list of"?

+    printf(_("  ECHO               write all input lines to standard
output\n"));

This message seems not to be correct when ECHO=queries is set.

+    printf(_("  COMP_KEYWORD_CASE  determines which letter case to
use when completing an SQL key word\n"));
+    printf(_("  DBNAME             name of currently connected database\n"));
+    printf(_("  ECHO               write all input lines to standard
output\n"));

I found that some help message line uses a normal form of a verb, but
other does not.
We should standardize them?

+    printf(_("  PROMPT1, PROMPT2, PROMPT3  specify the psql prompt\n"));

When the option name field is long, we should add a new line just
after the name field
and align the starting position of the option explanation field. That is,
for example, the above should be

printf(_("  PROMPT1, PROMPT2, PROMPT3\n"
             "                     specify the psql prompt\n"));

+    printf(_("  ON_ERROR_ROLLBACK  when on, ROLLBACK on error\n"));

This message seems incorrect to me. When this option is on and an error occurs
in transaction, transaction continues rather than ROLLBACK occurs, IIUC.
I did not check whole help messages yet, but ISTM some messages are not correct.
It's better to check them again.

+    printf(_("  PSQL_RC            alternative location of the user's
.psqlrc file\n"));

Typo: PSQL_RC should be PSQLRC

+    printf(_("  PGDATABASE         same as the dbname connection
parameter\n"));
+    printf(_("  PGHOST             same as the host connection parameter\n"));
+        printf(_("  PGPORT             same as the port connection
parameter\n"));
+    printf(_("  PGUSER             same as the user connection parameter\n"));
+    printf(_("  PGPASSWORD         possibility to set password (not
recommended)\n"));
+    printf(_("  PGPASSFILE         password file (default ~/.pgpass)\n"));

I don't think that psql needs to display the help messages of even environment
variables supported by libpq.

Regards,

--
Fujii Masao

Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
"MauMau"
Date:
OK, let me help you, though I'm only a Japanese who is never confident in my 
English.

(1)
As Fujii-san pointed out, could you add explanation for --help-variables in 
doc/src/sgml/ref/psqlref.sgml?


(2)
+ printf(_("  --help-variables         list of available configuration 
variables (options), then exit\n"));

should better be:

+ printf(_("  --help-variables         show A list of all specially treated 
variables, then exit\n"));

This follows the psql manual page.  Similarly,

+ printf(_("List of variables (options) for use from command line.\n"));

should be:

+ printf(_("List of specially treated variables.\n"));


(3)
+ printf(_("  ECHO               control what input can be writtent to 
standard output [all, queries]\n"));

"writtent" should be "written".  "controls" should be "control" like other 
options.


(4)
+ printf(_("  ECHO_HIDDEN        display internal queries (same as -E 
option)\n"));

should better be:

+ printf(_("  ECHO_HIDDEN        display internal queries executed by 
backslash commands\n"));

I think "(same as ...)" can be omitted to keep the description short.  If 
you want to retain it, other variables should also accompany similar 
description, such as -a for ECHO.


(5)
+ printf(_("  FETCH_COUNT        fetch many rows at a time (use less memory) 
(default 0 unlimited)\n"));

should better be:

+ printf(_("  FETCH_COUNT        the number of result rows to fetch and 
display at a time (default: 0=unlimited)\n"));


(6)
+ printf(_("  HISTCONTROL        when set, controls history list 
[ignorespace, ignoredups, ignoreboth]\n"));

should better be:

+ printf(_("  HISTCONTROL        control history list [ignorespace, 
ignoredups, ignoreboth]\n"));


(7)
+ printf(_("  USER               the database user currently connected\n"));

should add "as" at the end:

+ printf(_("  USER               the database user currently connected 
as\n"));


(8)
"Printing options" section lack the following ones described in psql manual:

columns
expanded (or x)
footer
numericlocale
tableattr (or T)


(9)
+ printf(_("\nEnvironment options:\n"));

should be ""Environment variables".  And this section lacks description for 
Windows, such as:

+ printf(_("  NAME=VALUE [NAME=VALUE] psql ...\n  or \\setenv NAME [VALUE] 
in interactive mode\n\n"));
+ printf(_("  PGPASSFILE         password file (default ~/.pgpass)\n"));

Regards
MauMau




Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:
Hello

Here is next update


2014-06-25 17:17 GMT+02:00 MauMau <maumau307@gmail.com>:
OK, let me help you, though I'm only a Japanese who is never confident in my English.

(1)
As Fujii-san pointed out, could you add explanation for --help-variables in doc/src/sgml/ref/psqlref.sgml?


(2)

+ printf(_("  --help-variables         list of available configuration variables (options), then exit\n"));

should better be:

+ printf(_("  --help-variables         show A list of all specially treated variables, then exit\n"));

This follows the psql manual page.  Similarly,

+ printf(_("List of variables (options) for use from command line.\n"));

should be:

+ printf(_("List of specially treated variables.\n"));


(3)
+ printf(_("  ECHO               control what input can be writtent to standard output [all, queries]\n"));

"writtent" should be "written".  "controls" should be "control" like other options.


(4)
+ printf(_("  ECHO_HIDDEN        display internal queries (same as -E option)\n"));

should better be:

+ printf(_("  ECHO_HIDDEN        display internal queries executed by backslash commands\n"));

I think "(same as ...)" can be omitted to keep the description short.  If you want to retain it, other variables should also accompany similar description, such as -a for ECHO.


(5)
+ printf(_("  FETCH_COUNT        fetch many rows at a time (use less memory) (default 0 unlimited)\n"));

should better be:

+ printf(_("  FETCH_COUNT        the number of result rows to fetch and display at a time (default: 0=unlimited)\n"));


(6)
+ printf(_("  HISTCONTROL        when set, controls history list [ignorespace, ignoredups, ignoreboth]\n"));

should better be:

+ printf(_("  HISTCONTROL        control history list [ignorespace, ignoredups, ignoreboth]\n"));


(7)
+ printf(_("  USER               the database user currently connected\n"));

should add "as" at the end:

+ printf(_("  USER               the database user currently connected as\n"));


(8)
"Printing options" section lack the following ones described in psql manual:

columns
expanded (or x)
footer
numericlocale
tableattr (or T)

fixed
 


(9)
+ printf(_("\nEnvironment options:\n"));

should be ""Environment variables".  And this section lacks description for Windows, such as:

+ printf(_("  NAME=VALUE [NAME=VALUE] psql ...\n  or \\setenv NAME [VALUE] in interactive mode\n\n"));

+ printf(_("  PGPASSFILE         password file (default ~/.pgpass)\n"));

??? -

Regards

Pavel
 

Regards
MauMau


Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
"MauMau"
Date:
Hello,

From: "Pavel Stehule" <pavel.stehule@gmail.com>
> fixed

Thank you.  All is fine.


>> should be ""Environment variables".  And this section lacks description
>> for Windows, such as:
>>
>> + printf(_("  NAME=VALUE [NAME=VALUE] psql ...\n  or \\setenv NAME 
>> [VALUE]
>> in interactive mode\n\n"));
>>
>> + printf(_("  PGPASSFILE         password file (default ~/.pgpass)\n"));
>>
>
> ??? -

I meant that how to set environment variables on Windows command prompt is 
different from on UNIX/Linux, and the default password file path is also 
different on Windows.  Do we describe them in this help?


Lastly, to follow most of your descriptions, "s" at the end of the first 
verb in these messages should be removed.  For example, use "set" instead of 
"sets".

+ printf(_("  COMP_KEYWORD_CASE  determines which letter case to use when 
completing an SQL key word\n"));
+ printf(_("  columns            sets the target width for the wrapped 
format\n"));
+ printf(_("  linestyle          sets the border line drawing style [ascii, 
old-ascii, unicode]\n"));
+ printf(_("  recordsep          specifies the record (line) separator to 
use in unaligned output format\n"));
+ printf(_("  title              sets the table title for any subsequently 
printed tables\n"));


This is all I noticed in the review.


Regards
MauMau




Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:



2014-06-26 15:26 GMT+02:00 MauMau <maumau307@gmail.com>:
Hello,

From: "Pavel Stehule" <pavel.stehule@gmail.com>
fixed

Thank you.  All is fine.



should be ""Environment variables".  And this section lacks description
for Windows, such as:

+ printf(_("  NAME=VALUE [NAME=VALUE] psql ...\n  or \\setenv NAME [VALUE]
in interactive mode\n\n"));

+ printf(_("  PGPASSFILE         password file (default ~/.pgpass)\n"));


??? -

I meant that how to set environment variables on Windows command prompt is different from on UNIX/Linux, and the default password file path is also different on Windows.  Do we describe them in this help?

hmm, I'll check it

Pavel
 


Lastly, to follow most of your descriptions, "s" at the end of the first verb in these messages should be removed.  For example, use "set" instead of "sets".


+ printf(_("  COMP_KEYWORD_CASE  determines which letter case to use when completing an SQL key word\n"));
+ printf(_("  columns            sets the target width for the wrapped format\n"));
+ printf(_("  linestyle          sets the border line drawing style [ascii, old-ascii, unicode]\n"));
+ printf(_("  recordsep          specifies the record (line) separator to use in unaligned output format\n"));
+ printf(_("  title              sets the table title for any subsequently printed tables\n"));


This is all I noticed in the review.


Regards
MauMau


Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Petr Jelinek
Date:
Hello,

I went through the patch, seems mostly fine, I adjusted some wording,
removed the default .pgpass file info since it's not accurate, and
replaced couple of phrases with (hopefully) more informative ones.


--
  Petr Jelinek                  http://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services

Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:
Hello

thank you Peter, so now only setting for MS Windows is missing?

Regards

Pavel


2014-06-26 21:57 GMT+02:00 Petr Jelinek <petr@2ndquadrant.com>:
Hello,

I went through the patch, seems mostly fine, I adjusted some wording, removed the default .pgpass file info since it's not accurate, and replaced couple of phrases with (hopefully) more informative ones.


--
 Petr Jelinek                  http://www.2ndQuadrant.com/

 PostgreSQL Development, 24x7 Support, Training & Services

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:
Hello

I modified description of setting system variables in dependency on O.S.

Regards

Pavel




2014-06-27 8:54 GMT+02:00 Pavel Stehule <pavel.stehule@gmail.com>:
Hello

thank you Peter, so now only setting for MS Windows is missing?

Regards

Pavel


2014-06-26 21:57 GMT+02:00 Petr Jelinek <petr@2ndquadrant.com>:

Hello,

I went through the patch, seems mostly fine, I adjusted some wording, removed the default .pgpass file info since it's not accurate, and replaced couple of phrases with (hopefully) more informative ones.


--
 Petr Jelinek                  http://www.2ndQuadrant.com/

 PostgreSQL Development, 24x7 Support, Training & Services


Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
"MauMau"
Date:
From: "Pavel Stehule" <pavel.stehule@gmail.com>
> I modified description of setting system variables in dependency on O.S.

Thank you, it's almost OK.  As mentioned in my previous mail, I think 
"determines" should be "determine" to follow other messages.  I'll mark this 
patch as ready for committer when this is fixed.

+ printf(_("  COMP_KEYWORD_CASE  determines which letter case to use when 
completing an SQL key word\n"));

Personally, I don't think we have to describe how to set environment 
variables, because it's preliminary knowledge and not specific to 
PostgreSQL.  However, I don't mind if you retain or remove the description.

Regards
MauMau






Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:
Hi


2014-06-29 0:48 GMT+02:00 MauMau <maumau307@gmail.com>:
From: "Pavel Stehule" <pavel.stehule@gmail.com>

I modified description of setting system variables in dependency on O.S.

Thank you, it's almost OK.  As mentioned in my previous mail, I think "determines" should be "determine" to follow other messages.  I'll mark this patch as ready for committer when this is fixed.


fixes


+ printf(_("  COMP_KEYWORD_CASE  determines which letter case to use when completing an SQL key word\n"));

Personally, I don't think we have to describe how to set environment variables, because it's preliminary knowledge and not specific to PostgreSQL.  However, I don't mind if you retain or remove the description.

ok

Regards

Pavel
 

Regards
MauMau




Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
"MauMau"
Date:
Thanks, I marked it as ready for committer.  I hope Fujii san or another 
committer will commit this, refining English expression if necessary.

Regards
MauMau




Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:



2014-06-29 13:35 GMT+02:00 MauMau <maumau307@gmail.com>:
Thanks, I marked it as ready for committer.  I hope Fujii san or another committer will commit this, refining English expression if necessary.

sure

Thank you very much

Regards

Pavel
 

Regards
MauMau


Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Abhijit Menon-Sen
Date:
At 2014-06-29 20:35:04 +0900, maumau307@gmail.com wrote:
>
> Thanks, I marked it as ready for committer.  I hope Fujii san or
> another committer will commit this, refining English expression if
> necessary.

Since it was just a matter of editing, I went through the patch and
corrected various minor errors (typos, awkwardness, etc.). I agree
that this is now ready for committer.

I've attached the updated diff.

-- Abhijit

Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:



2014-06-29 15:24 GMT+02:00 Abhijit Menon-Sen <ams@2ndquadrant.com>:
At 2014-06-29 20:35:04 +0900, maumau307@gmail.com wrote:
>
> Thanks, I marked it as ready for committer.  I hope Fujii san or
> another committer will commit this, refining English expression if
> necessary.

Since it was just a matter of editing, I went through the patch and
corrected various minor errors (typos, awkwardness, etc.). I agree
that this is now ready for committer.

I've attached the updated diff.

I checked it, and it looks well

Thank you

Regards

Pavel
 

-- Abhijit

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Alvaro Herrera
Date:
Abhijit Menon-Sen wrote:
> At 2014-06-29 20:35:04 +0900, maumau307@gmail.com wrote:
> >
> > Thanks, I marked it as ready for committer.  I hope Fujii san or
> > another committer will commit this, refining English expression if
> > necessary.
> 
> Since it was just a matter of editing, I went through the patch and
> corrected various minor errors (typos, awkwardness, etc.). I agree
> that this is now ready for committer.

FWIW I think "determines" was correct.



-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Andres Freund
Date:
On 2014-06-29 18:54:50 +0530, Abhijit Menon-Sen wrote:
> At 2014-06-29 20:35:04 +0900, maumau307@gmail.com wrote:
> >
> > Thanks, I marked it as ready for committer.  I hope Fujii san or
> > another committer will commit this, refining English expression if
> > necessary.
> 
> Since it was just a matter of editing, I went through the patch and
> corrected various minor errors (typos, awkwardness, etc.). I agree
> that this is now ready for committer.
> 
> I've attached the updated diff.

I'm looking at committing this, but I wonder: Shouldn't this be
accessible from inside psql as well? I.e. as a backslash command?

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Petr Jelinek
Date:
On 26/08/14 13:20, Andres Freund wrote:
>
> I'm looking at committing this, but I wonder: Shouldn't this be
> accessible from inside psql as well? I.e. as a backslash command?
>

+1


--  Petr Jelinek                  http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:



2014-08-26 13:30 GMT+02:00 Petr Jelinek <petr@2ndquadrant.com>:
On 26/08/14 13:20, Andres Freund wrote:

I'm looking at committing this, but I wonder: Shouldn't this be
accessible from inside psql as well? I.e. as a backslash command?


+1

have you idea about command name?  \?+

Pavel


 


--
 Petr Jelinek                  http://www.2ndQuadrant.com/

 PostgreSQL Development, 24x7 Support, Training & Services

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Andres Freund
Date:
On 2014-08-26 13:44:16 +0200, Pavel Stehule wrote:
> 2014-08-26 13:30 GMT+02:00 Petr Jelinek <petr@2ndquadrant.com>:
> 
> > On 26/08/14 13:20, Andres Freund wrote:
> >
> >>
> >> I'm looking at committing this, but I wonder: Shouldn't this be
> >> accessible from inside psql as well? I.e. as a backslash command?
> >>
> >>
> > +1
> >
> 
> have you idea about command name?  \?+

Some ideas:

\hv
\help-variables
\? set
\? variables


Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:
Hi

I chose \? xxx, because it is related to psql features. I wrote commands:

\? options
\? variables

comments?

Regards

Pavel



2014-08-26 13:48 GMT+02:00 Andres Freund <andres@2ndquadrant.com>:
On 2014-08-26 13:44:16 +0200, Pavel Stehule wrote:
> 2014-08-26 13:30 GMT+02:00 Petr Jelinek <petr@2ndquadrant.com>:
>
> > On 26/08/14 13:20, Andres Freund wrote:
> >
> >>
> >> I'm looking at committing this, but I wonder: Shouldn't this be
> >> accessible from inside psql as well? I.e. as a backslash command?
> >>
> >>
> > +1
> >
>
> have you idea about command name?  \?+

Some ideas:

\hv
\help-variables
\? set
\? variables


Greetings,

Andres Freund

--
 Andres Freund                     http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Andres Freund
Date:
Hi,

On 2014-08-27 22:48:54 +0200, Pavel Stehule wrote:
> Hi
>
> I chose \? xxx, because it is related to psql features. I wrote commands:
>
> \? options
> \? variables
>
> comments?

Generall I like it.

Some stuff I changed:
* I rephrased the sgml changes
* s/Printing options/Display options/. Or maybe "Display influencing
  variables"? That makes it clearer why they're listed under
  --help-variables.
* I added \? commands as an alias for a plain \?
  That way the scheme can sensibly be expanded.
* I renamed help_variables() to be inline with the surrounding functions.

Stuff I wondered about:
* How about making it --help=variables instead of --help-variables? That
* Do we really need the 'Report bugs to' blurb for --help-variables?
* Since we're not exhaustive about documenting environment variales, do
  we really need to document TMPDIR and SHELL?
* Shouldn't we document that PROMPT1 is the standard prompt, PROMPT2 is
  for already started statements, and PROMPT3 is for COPY FROM STDIN?

Looks like it's commitable next round.

I've attached a incremental patch.

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Fujii Masao
Date:
On Thu, Aug 28, 2014 at 8:20 PM, Andres Freund <andres@2ndquadrant.com> wrote:
> Hi,
>
> On 2014-08-27 22:48:54 +0200, Pavel Stehule wrote:
>> Hi
>>
>> I chose \? xxx, because it is related to psql features. I wrote commands:
>>
>> \? options
>> \? variables
>>
>> comments?
>
> Generall I like it.
>
> Some stuff I changed:
> * I rephrased the sgml changes
> * s/Printing options/Display options/. Or maybe "Display influencing
>   variables"? That makes it clearer why they're listed under
>   --help-variables.
> * I added \? commands as an alias for a plain \?
>   That way the scheme can sensibly be expanded.
> * I renamed help_variables() to be inline with the surrounding functions.
>
> Stuff I wondered about:
> * How about making it --help=variables instead of --help-variables? That
> * Do we really need the 'Report bugs to' blurb for --help-variables?
> * Since we're not exhaustive about documenting environment variales, do
>   we really need to document TMPDIR and SHELL?
> * Shouldn't we document that PROMPT1 is the standard prompt, PROMPT2 is
>   for already started statements, and PROMPT3 is for COPY FROM STDIN?
>
> Looks like it's commitable next round.
>
> I've attached a incremental patch.

ISTM that you failed to attach the right patch.
help-variables-10--11.diff contains only one line.

Regards,

-- 
Fujii Masao



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Andres Freund
Date:
On 2014-08-28 13:20:07 +0200, Andres Freund wrote:
> I've attached a incremental patch.

Apparently I didn't attach the patch, as so much a file containing the
name of the patchfile...


Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:



2014-08-28 13:20 GMT+02:00 Andres Freund <andres@2ndquadrant.com>:
Hi,

On 2014-08-27 22:48:54 +0200, Pavel Stehule wrote:
> Hi
>
> I chose \? xxx, because it is related to psql features. I wrote commands:
>
> \? options
> \? variables
>
> comments?

Generall I like it.

Some stuff I changed:
* I rephrased the sgml changes
* s/Printing options/Display options/. Or maybe "Display influencing
  variables"? That makes it clearer why they're listed under
  --help-variables.
* I added \? commands as an alias for a plain \?
  That way the scheme can sensibly be expanded.
* I renamed help_variables() to be inline with the surrounding functions.

Stuff I wondered about:
* How about making it --help=variables instead of --help-variables? That

I am sorry, I don't like this idea --help-variables is much more usual for cmd line
 
* Do we really need the 'Report bugs to' blurb for --help-variables?
 
* Since we're not exhaustive about documenting environment variales, do
  we really need to document TMPDIR and SHELL?
* Shouldn't we document that PROMPT1 is the standard prompt, PROMPT2 is
  for already started statements, and PROMPT3 is for COPY FROM STDIN?

I don't see TMPDIR, SHELL as really important in this position

Pavel
 

Looks like it's commitable next round.

I've attached a incremental patch.

Greetings,

Andres Freund

--
 Andres Freund                     http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Petr Jelinek
Date:
On 28/08/14 13:20, Andres Freund wrote:
> Hi,
>
> Stuff I wondered about:
> * How about making it --help=variables instead of --help-variables?

-1, help is not a variable to be assigned imho

> * Do we really need the 'Report bugs to' blurb for --help-variables?

Probably not.

> * Since we're not exhaustive about documenting environment variales, do
>    we really need to document TMPDIR and SHELL?

They are bit more important than most of others, but probably not really 
necessary to be there as they are not psql specific.

> * Shouldn't we document that PROMPT1 is the standard prompt, PROMPT2 is
>    for already started statements, and PROMPT3 is for COPY FROM STDIN?

Yes please!

--  Petr Jelinek                  http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training &
Services



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Fujii Masao
Date:
On Thu, Aug 28, 2014 at 5:48 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> comments?

+    fprintf(output, _("  ECHO               control what input is
written to standard output [all, queries]\n"));

The valid values in the help messages should be consistent with
the values that the tab-completion displays. So in the case of ECHO,
"errors" and "none" also should be added in the message. Thought?

In the help messages of some psql variables like ECHO_HIDDEN, valid
values are not explained. Why not?

Regards,

-- 
Fujii Masao



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:



2014-08-28 14:22 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
On Thu, Aug 28, 2014 at 5:48 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> comments?

+    fprintf(output, _("  ECHO               control what input is
written to standard output [all, queries]\n"));

The valid values in the help messages should be consistent with
the values that the tab-completion displays. So in the case of ECHO,
"errors" and "none" also should be added in the message. Thought?

In the help messages of some psql variables like ECHO_HIDDEN, valid
values are not explained. Why not?

it is based on http://www.postgresql.org/docs/9.4/static/app-psql.html

ECHO_HIDDEN

When this variable is set and a backslash command queries the database, the query is first shown. This way you can study the PostgreSQL internals and provide similar functionality in your own programs. (To select this behavior on program start-up, use the switch -E.) If you set the variable to the value noexec, the queries are just shown but are not actually sent to the server and executed.

There are no clear a set of valid values :( .. When I found a known fields in doc, I used it.

Regards

Pavel
 

Regards,

--
Fujii Masao

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Andres Freund
Date:
On 2014-08-28 14:04:27 +0200, Petr Jelinek wrote:
> On 28/08/14 13:20, Andres Freund wrote:
> >Hi,
> >
> >Stuff I wondered about:
> >* How about making it --help=variables instead of --help-variables?
> 
> -1, help is not a variable to be assigned imho

I don't think variable assignment is a good mental model for long
commandline arguments. And it's not like I'm the first to come up with
an extensible --help. Check e.g. gcc.

But anyway, I guess I've lost that argument.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Fujii Masao
Date:
On Thu, Aug 28, 2014 at 9:34 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
>
>
> 2014-08-28 14:22 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
>
>> On Thu, Aug 28, 2014 at 5:48 AM, Pavel Stehule <pavel.stehule@gmail.com>
>> wrote:
>> > comments?
>>
>> +    fprintf(output, _("  ECHO               control what input is
>> written to standard output [all, queries]\n"));
>>
>> The valid values in the help messages should be consistent with
>> the values that the tab-completion displays. So in the case of ECHO,
>> "errors" and "none" also should be added in the message. Thought?
>>
>> In the help messages of some psql variables like ECHO_HIDDEN, valid
>> values are not explained. Why not?
>
>
> it is based on http://www.postgresql.org/docs/9.4/static/app-psql.html
>
> ECHO_HIDDEN
>
> When this variable is set and a backslash command queries the database, the
> query is first shown. This way you can study the PostgreSQL internals and
> provide similar functionality in your own programs. (To select this behavior
> on program start-up, use the switch -E.) If you set the variable to the
> value noexec, the queries are just shown but are not actually sent to the
> server and executed.
>
> There are no clear a set of valid values :( .. When I found a known fields
> in doc, I used it.

At least "noexec" seems to be documented as a valid value. Of course,
it's better to document other valid values.

Regards,

-- 
Fujii Masao



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:
Hello

fixed ECHO, ECHO_HIDDEN, PROPMPT

Regards

Pavel



2014-09-01 11:52 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
On Thu, Aug 28, 2014 at 9:34 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
>
>
> 2014-08-28 14:22 GMT+02:00 Fujii Masao <masao.fujii@gmail.com>:
>
>> On Thu, Aug 28, 2014 at 5:48 AM, Pavel Stehule <pavel.stehule@gmail.com>
>> wrote:
>> > comments?
>>
>> +    fprintf(output, _("  ECHO               control what input is
>> written to standard output [all, queries]\n"));
>>
>> The valid values in the help messages should be consistent with
>> the values that the tab-completion displays. So in the case of ECHO,
>> "errors" and "none" also should be added in the message. Thought?
>>
>> In the help messages of some psql variables like ECHO_HIDDEN, valid
>> values are not explained. Why not?
>
>
> it is based on http://www.postgresql.org/docs/9.4/static/app-psql.html
>
> ECHO_HIDDEN
>
> When this variable is set and a backslash command queries the database, the
> query is first shown. This way you can study the PostgreSQL internals and
> provide similar functionality in your own programs. (To select this behavior
> on program start-up, use the switch -E.) If you set the variable to the
> value noexec, the queries are just shown but are not actually sent to the
> server and executed.
>
> There are no clear a set of valid values :( .. When I found a known fields
> in doc, I used it.

At least "noexec" seems to be documented as a valid value. Of course,
it's better to document other valid values.

Regards,

--
Fujii Masao

Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Robert Haas
Date:
On Thu, Aug 28, 2014 at 11:20 AM, Andres Freund <andres@2ndquadrant.com> wrote:
>> >* How about making it --help=variables instead of --help-variables?
>>
>> -1, help is not a variable to be assigned imho
>
> I don't think variable assignment is a good mental model for long
> commandline arguments. And it's not like I'm the first to come up with
> an extensible --help. Check e.g. gcc.
>
> But anyway, I guess I've lost that argument.

I think it mostly depends on how far we think we might extend it.  I
mean, --help-variables is fine as a parallel to --help.  But if we're
eventually going to have help for 12 things, --help=TOPIC is a lot
better than 12 separate switches.  So +0.5 for your proposal from me.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:
Hi

here is a second variant with support --help=variables

Regards

Pavel


2014-09-04 4:25 GMT+02:00 Robert Haas <robertmhaas@gmail.com>:
On Thu, Aug 28, 2014 at 11:20 AM, Andres Freund <andres@2ndquadrant.com> wrote:
>> >* How about making it --help=variables instead of --help-variables?
>>
>> -1, help is not a variable to be assigned imho
>
> I don't think variable assignment is a good mental model for long
> commandline arguments. And it's not like I'm the first to come up with
> an extensible --help. Check e.g. gcc.
>
> But anyway, I guess I've lost that argument.

I think it mostly depends on how far we think we might extend it.  I
mean, --help-variables is fine as a parallel to --help.  But if we're
eventually going to have help for 12 things, --help=TOPIC is a lot
better than 12 separate switches.  So +0.5 for your proposal from me.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Andres Freund
Date:
On 2014-08-28 13:54:28 +0200, Andres Freund wrote:
> On 2014-08-28 13:20:07 +0200, Andres Freund wrote:
> > I've attached a incremental patch.
> 
> Apparently I didn't attach the patch, as so much a file containing the
> name of the patchfile...

Which you obviously didn't integrate. And didn't comment on. Grr.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Andres Freund
Date:
Hi,

Given we already have three topics for --help and I can see others I
went with my --help= proposal.

On 2014-08-28 13:20:07 +0200, Andres Freund wrote:
> Some stuff I changed:
> * I rephrased the sgml changes
> * s/Printing options/Display options/. Or maybe "Display influencing
>   variables"? That makes it clearer why they're listed under
>   --help-variables.
> * I added \? commands as an alias for a plain \?
>   That way the scheme can sensibly be expanded.
> * I renamed help_variables() to be inline with the surrounding functions.

I integrated all those ontop of your help-variables-12.patch.

Then I:
* re-added psql -i which you, probably accidentally, removed
* rephrased the sgml stuff
* removed the "Report bugs to " from helpVariables()
* Changed things so that both --help and \? support "commands",
  "options" and "variables" as help topics
* fixed things so that --help=wrongoption returns a proper exit code
  again

I attached both the full and the incremental diff. I'd appreciate
somebody looking over the the docs...

I plan to push this soon.

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Andres Freund
Date:
On 2014-09-09 22:22:45 +0200, Andres Freund wrote:
> I plan to push this soon.

Done.

Thanks for the patch!

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]

From
Pavel Stehule
Date:


2014-09-10 0:13 GMT+02:00 Andres Freund <andres@2ndquadrant.com>:
On 2014-09-09 22:22:45 +0200, Andres Freund wrote:
> I plan to push this soon.

Done.

Thanks for the patch!

Thank you very much

Pavel
 

Andres Freund

--
 Andres Freund                     http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services