Fwd: warning about console code page on starting psql

From: David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org, "pgsql-docs(at)postgresql(dot)org" <pgsql-docs(at)postgresql(dot)org>
Subject: Fwd: warning about console code page on starting psql
Date: 2014-12-17 06:01:44
Message-ID: CAKFQuwaT55DVMResDFbvscdT5jigTAE5Z+sp6P8Zc8kgXThJCQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-novice

Forwarding to -docs for now.

I suggest simply dropping the "cmd.exe /c"part from the docs and mention
that the command should be run from an active console. A recommendation
for a batch file or similar would be nice. I may put together an actual
patch if I get a chance and don't see one come across but for now just
reporting this. Would want to research methods for making both these items
persist and recommending such. See my other curiosities below...

David J.

---------- Forwarded message ----------
From: *David G Johnston [via PostgreSQL]* <
ml-node+s1045698n5831042h26(at)n5(dot)nabble(dot)com>
Date: Tuesday, December 16, 2014
Subject: Re: warning about console code page on starting psql
To: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>

Stephen Cook-2 wrote
On 12/16/2014 11:10 PM, Scott Robertson wrote:
> Set the code page by entering cmd.exe /c chcp 1252. (1252 is a code
> page that is appropriate for German; replace it with your value.) If
> you are using Cygwin, you can put this command in /etc/profile.

Do not type the "cmd.exe /c" part. This will run a new instance of "cmd"
(the Windows command-line console); "\c" means "run the following
command"... So you are basically starting a new console, changing the
code page within that new console, and exiting back to your original
console.

Instead, once you have a command prompt, use "chcp 1252" to change the
code page of the Windows console to match the code page "psql" expects
from Windows. Then you can run "psql" without the warning. You will have
to do this each time you open a new command line console, before running
"psql", as far as I can tell.

-- Stephen

So basically the documented fix is useless. At least a "/k" would keep the
new console with altered code page around for interactive use but the /c
switch simply kills the console after running a single command whose sole
purpose is to change the to-be-killed console's codepage.

It is implied that since you are chasing the console codepage that the
target value would be whatever Window's is using...but that could be made
more clear as well.

Encodings are confusing and this doesn't even mention using windows psql
against Linux or how Unicode would fit in - though external notes indicate
that the font change suggestion also solves Unicode characters as well as
dealing with ANSI...

http://ss64.com/nt/chcp.html

David J.

------------------------------
If you reply to this email, your message will be added to the discussion
below:
http://postgresql.nabble.com/warning-about-console-code-page-on-starting-psql-tp5831036p5831042.html
To unsubscribe from warning about console code page on starting psql, click
here
<http://postgresql.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5831036&code=ZGF2aWQuZy5qb2huc3RvbkBnbWFpbC5jb218NTgzMTAzNnwtMzI2NTA0MzIx>
.
NAML
<http://postgresql.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David Johnston 2014-12-17 06:06:24 Re: warning about console code page on starting psql
Previous Message David G Johnston 2014-12-17 05:55:07 Re: warning about console code page on starting psql

Browse pgsql-novice by date

  From Date Subject
Next Message David Johnston 2014-12-17 06:06:24 Re: warning about console code page on starting psql
Previous Message David G Johnston 2014-12-17 05:55:07 Re: warning about console code page on starting psql