Re: warning about console code page on starting psql

From: Michael Wood <esiotrot(at)gmail(dot)com>
To: Scott Robertson <stumpednomore(at)gmail(dot)com>
Cc: PostgreSQL List - Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: warning about console code page on starting psql
Date: 2014-12-18 06:27:52
Message-ID: CAP6d-HVg9oY+FuDKyvigtVoAhC_3KD0_+67ege85bhYUS3NwYA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-novice

Hi Scott

Sorry, I forgot to Cc the list earlier when I was replying from my phone.

On 18 December 2014 at 07:38, Scott Robertson <stumpednomore(at)gmail(dot)com> wrote:
>
>
> On 12/18/2014 1:17 PM, Michael Wood wrote:
>
> > Hi
> >
> > On 17 Dec 2014 9:10 AM, "Scott Robertson" <stumpednomore(at)gmail(dot)com> wrote:
> > >
> > >
> > > On 12/17/2014 2:15 PM, David Johnston wrote:
> > >>
> > ...
> > >> I don't know psql is launched on windows (or, specifically, how you are launching it) so cannot answer that particular question. Using "start->run" you can type "cmd" then in the resulting console change the codepage before manually running "psql"
> > >
> > > Tried this, nothing changed.
> >
> > I get the impression you are talking past each other.
> >
> > Try this:
> >
> > Click on Start -> Run and type cmd.exe
> > Inside the black window that comes up, run chcp 1252 and change the font.
> > Still inside the same clack window type psql.

Oops, "clack" was meant to be "black". I'd blame my phone, but not sure
I'd be believed :)

> Michael, good advice, thanks. Here is what I did and it has got me down the road quite a ways, now it seems I have to study the chapter on
> user authentication since, if I go in this way instead of using the psql console, postgresql now relates to me as my Windows user account name
> Luther. I tried the password for that, as well as the password for pg superuser postgres, but neither was accepted. So I think I have to make a
> map to equate Luther with postgres.
>
> This is what I did:
>
> Microsoft Windows [Version 6.1.7600]
> Copyright (c) 2009 Microsoft Corporation. All rights reserved.
>
> C:\Users\Luther>cd\
>
> C:\>chcp
> Active code page: 437
>
> C:\>chcp 1252
> Active code page: 1252

I assume you also changed the font. Since I don't currently use
Postgres and have never used it on Windows, I'm not sure how important
it is to change the font, but since it was mentioned in the docs, I
assume it should be done.

> C:\>cd \program files\postgresql\9.4\bin\
>
> C:\Program Files\PostgreSQL\9.4\bin>psql
> Password:
> psql: FATAL: password authentication failed for user "Luther"
>
> C:\Program Files\PostgreSQL\9.4\bin>psql
> Password:
> psql: FATAL: password authentication failed for user "Luther"

The way you were running psql before seems to be via a .bat or .cmd
file. Did the authentication work that way? If so, it might be easiest
to edit that file to add in the "chcp 1252" command before the call to
the actual psql command. Or otherwise see how that file calls the
actual psql command and do the same thing manually.

If you decide to edit the .bat (or .cmd) file, make a backup of it first
in case you make a mistake.

Good luck.

--
Michael Wood <esiotrot(at)gmail(dot)com>

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Scott Robertson 2014-12-18 06:35:56 Re: warning about console code page on starting psql
Previous Message Magnus Hagander 2014-12-17 09:01:06 Re: Typo in 49.2.1

Browse pgsql-novice by date

  From Date Subject
Next Message Scott Robertson 2014-12-18 06:35:56 Re: warning about console code page on starting psql
Previous Message Kevin Grittner 2014-12-17 14:48:40 Re: Why "vacuum_freeze_min_age" parameter has context as "USER" ?