Thread: pgsql: Improve pg_ctl "cannot connect" warning, per suggestion from Mag
Improve pg_ctl "cannot connect" warning, per suggestion from Magnus. Branch ------ master Details ------- http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=4646e0cef70d2f9a6bb1764cee5c13b7bbd23625 Modified Files -------------- src/bin/pg_ctl/pg_ctl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Bruce Momjian <bruce@momjian.us> writes: > Improve pg_ctl "cannot connect" warning, per suggestion from Magnus. Why does this string contain doubled spaces? regards, tom lane
Re: pgsql: Improve pg_ctl "cannot connect" warning, per suggestion from Mag
From
Bruce Momjian
Date:
Tom Lane wrote: > Bruce Momjian <bruce@momjian.us> writes: > > Improve pg_ctl "cannot connect" warning, per suggestion from Magnus. > > Why does this string contain doubled spaces? You mean two spaces after a semicolon? Isn't that normal? This is the string: write_stderr(_("warning: could not connect; might be due to invalid authentication or\n" "misconfiguration.\n")); -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +
Bruce Momjian <bruce@momjian.us> writes: > Tom Lane wrote: >> Why does this string contain doubled spaces? > You mean two spaces after a semicolon? Isn't that normal? This is the > string: Normal according to what? In any case translatable error strings are not supposed to attempt to do formatting, and formatting is what that looks like to me. regards, tom lane
Re: pgsql: Improve pg_ctl "cannot connect" warning, per suggestion from Mag
From
Bruce Momjian
Date:
Tom Lane wrote: > Bruce Momjian <bruce@momjian.us> writes: > > Tom Lane wrote: > >> Why does this string contain doubled spaces? > > > You mean two spaces after a semicolon? Isn't that normal? This is the > > string: > > Normal according to what? In any case translatable error strings are > not supposed to attempt to do formatting, and formatting is what that > looks like to me. Well, wikipedia says perhaps two spaces: http://en.wikipedia.org/wiki/Semicolon Semicolons are followed by a lower case letter, unless that letter is the first letter of a proper noun. They have no spaces before them, but one space after (possibly two when using monospaced fonts). but answers.com says only one: http://wiki.answers.com/Q/How_many_spaces_after_a_colon_and_semicolon After a semicolon, there is never more than one space. so I have changed it to once space, and also reworded it: warning: could not connect; might be caused by invalid authentication or misconfiguration. That wording seems to match other messages better, though I feel pg_ctl seems to have sloppy output formatting in general. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +
Re: pgsql: Improve pg_ctl "cannot connect" warning, per suggestion from Mag
From
Andrew Dunstan
Date:
On 11/26/2010 10:04 AM, Bruce Momjian wrote: > Tom Lane wrote: >> Bruce Momjian<bruce@momjian.us> writes: >>> Tom Lane wrote: >>>> Why does this string contain doubled spaces? >>> You mean two spaces after a semicolon? Isn't that normal? This is the >>> string: >> Normal according to what? In any case translatable error strings are >> not supposed to attempt to do formatting, and formatting is what that >> looks like to me. > Well, wikipedia says perhaps two spaces: > > http://en.wikipedia.org/wiki/Semicolon > > Semicolons are followed by a lower case letter, unless that letter is > the first letter of a proper noun. They have no spaces before them, but > one space after (possibly two when using monospaced fonts). > > but answers.com says only one: > > http://wiki.answers.com/Q/How_many_spaces_after_a_colon_and_semicolon > After a semicolon, there is never more than one space. > > so I have changed it to once space, and also reworded it: > > warning: could not connect; might be caused by invalid authentication or > misconfiguration. > > That wording seems to match other messages better, though I feel pg_ctl > seems to have sloppy output formatting in general. > We're not typesetting a document here. I tend to think that we shouldn't have multiple spaces anywhere, in which case we should also remove the extra space following "warning:" above. AFAICT we don't use multiple spaces anywhere in the backend messages, and we should be consistent about it. cheers andrew
Re: pgsql: Improve pg_ctl "cannot connect" warning, per suggestion from Mag
From
Bruce Momjian
Date:
Andrew Dunstan wrote: > > > On 11/26/2010 10:04 AM, Bruce Momjian wrote: > > Tom Lane wrote: > >> Bruce Momjian<bruce@momjian.us> writes: > >>> Tom Lane wrote: > >>>> Why does this string contain doubled spaces? > >>> You mean two spaces after a semicolon? Isn't that normal? This is the > >>> string: > >> Normal according to what? In any case translatable error strings are > >> not supposed to attempt to do formatting, and formatting is what that > >> looks like to me. > > Well, wikipedia says perhaps two spaces: > > > > http://en.wikipedia.org/wiki/Semicolon > > > > Semicolons are followed by a lower case letter, unless that letter is > > the first letter of a proper noun. They have no spaces before them, but > > one space after (possibly two when using monospaced fonts). > > > > but answers.com says only one: > > > > http://wiki.answers.com/Q/How_many_spaces_after_a_colon_and_semicolon > > After a semicolon, there is never more than one space. > > > > so I have changed it to once space, and also reworded it: > > > > warning: could not connect; might be caused by invalid authentication or > > misconfiguration. > > > > That wording seems to match other messages better, though I feel pg_ctl > > seems to have sloppy output formatting in general. > > > > We're not typesetting a document here. I tend to think that we shouldn't > have multiple spaces anywhere, in which case we should also remove the > extra space following "warning:" above. AFAICT we don't use multiple > spaces anywhere in the backend messages, and we should be consistent > about it. Well, we use two space after an error label: __ NOTICE: CREATE TABLE will create implicit sequence "test_x_seq" for serial column "test.x" which I thought was what I was doing here. Should it be upper-case WARNING? I am fine with one space but wanted to point out why I used two. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +