pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Running Windows binaries from non-English folder
4+ messages / 3 participants
[nested] [flat]

* Running Windows binaries from non-English folder
@ 2017-11-07 19:30  Yuri Martsinovsky <captainsilver@gmail.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Yuri Martsinovsky @ 2017-11-07 19:30 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I put PostgreSQL binary files in Windows in a folder with Russian name, for
example:
C:\Постгрес

When I run pg_ctl.exe from the Command Prompt from this current directory I
get the following error:
could not find a "pg_ctl.exe" to execute

pg_ctl.exe file is actually there and it runs, but just prints the above
error to the console.

If I run
"C:\Постгрес\pg_ctl.exe"
I get this error:
invalid binary: "C:\????????\pg_ctl.exe"

The same happens when running initdb.exe
Looks like the utility just cannot access its own file because of the
russian characters.

The OS is Windows 10
I tried running "chcp 65001" in the console window to set UTF-8 encoding
for the console.

Similar errors happen if I put the binaries in English folder, but try to
run initdb for a non-english data folder

Does PostgreSQL for Windows support directories in UTF-8 or other encoding?

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Running Windows binaries from non-English folder
@ 2017-11-08 06:56  Thomas Kellerer <spam_eater@gmx.net>
  parent: Yuri Martsinovsky <captainsilver@gmail.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Thomas Kellerer @ 2017-11-08 06:56 UTC (permalink / raw)
  To: pgsql-admin

Yuri Martsinovsky schrieb am 07.11.2017 um 20:30:
> I put PostgreSQL binary files in Windows in a folder with Russian name, for example:
> C:\Постгрес
> 
> When I run pg_ctl.exe from the Command Prompt from this current directory I get the following error:
> could not find a "pg_ctl.exe" to execute
> 
> pg_ctl.exe file is actually there and it runs, but just prints the above error to the console.
> 
> If I run 
> "C:\Постгрес\pg_ctl.exe"
> I get this error:
> invalid binary: "C:\????????\pg_ctl.exe"
> 
> The same happens when running initdb.exe
> Looks like the utility just cannot access its own file because of the russian characters.
> 
> The OS is Windows 10
> I tried running "chcp 65001" in the console window to set UTF-8 encoding for the console.
> 
> Similar errors happen if I put the binaries in English folder, but try to run initdb for a non-english data folder
> 
> Does PostgreSQL for Windows support directories in UTF-8 or other encoding? 

I have encountered that as well even with plain ASCII names, but with spaces in it.

Try

"C:\Постгрес\"pg_ctl.exe

(That is: only quote the path, not the actual executable)

I think this happens if you start pg_ctl using an administrator account. 
pg_ctl drops the privileges then and restarts itself (or something like that) but it fails to extract the filename correctly if everything is quoted.

Thomas



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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Running Windows binaries from non-English folder
@ 2017-11-08 18:09  George Neuner <gneuner2@comcast.net>
  0 siblings, 1 reply; 4+ messages in thread

From: George Neuner @ 2017-11-08 18:09 UTC (permalink / raw)
  To: pgsql-admin

On Tue, 07 Nov 2017 19:30:46 +0000, Yuri Martsinovsky 
<captainsilver@gmail.com> wrote:
> If I run
> "C:\????????\pg_ctl.exe"
> I get this error:
> invalid binary: "C:\????????\pg_ctl.exe"
>
> The same happens when running initdb.exe
> Looks like the utility just cannot access its own file because of the
> russian characters.

Try running it using 8.3 path names.  Every file and folder in NTFS has 
2 names - one "natural" and a secondary "short" DOS 8.3 name+ext format 
name.  You can see short names using DIR /X in a console. The short 
names should be ASCII (subset) only.

E.g., on my system pg_ctl is in C:\program files\postgresql\9.6\bin.
   It's short name is  C:\PROGRA~1\POSTGR~1\9.6\bin\pg_ctl.exe

These short names don't permit spaces or non-printing characters, so 
they can work in situations where the natural name may not.

George


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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Running Windows binaries from non-English folder
@ 2017-11-08 19:02  Yuri Martsinovsky <captainsilver@gmail.com>
  parent: George Neuner <gneuner2@comcast.net>
  0 siblings, 0 replies; 4+ messages in thread

From: Yuri Martsinovsky @ 2017-11-08 19:02 UTC (permalink / raw)
  To: George Neuner <gneuner2@comcast.net>; +Cc: pgsql-admin

Thank you, George!
This should work. You are right, short names are ascii only
On Wed, Nov 8, 2017 at 10:10 George Neuner <gneuner2@comcast.net> wrote:

> On Tue, 07 Nov 2017 19:30:46 +0000, Yuri Martsinovsky
> <captainsilver@gmail.com> wrote:
> > If I run
> > "C:\????????\pg_ctl.exe"
> > I get this error:
> > invalid binary: "C:\????????\pg_ctl.exe"
> >
> > The same happens when running initdb.exe
> > Looks like the utility just cannot access its own file because of the
> > russian characters.
>
> Try running it using 8.3 path names.  Every file and folder in NTFS has
> 2 names - one "natural" and a secondary "short" DOS 8.3 name+ext format
> name.  You can see short names using DIR /X in a console. The short
> names should be ASCII (subset) only.
>
> E.g., on my system pg_ctl is in C:\program files\postgresql\9.6\bin.
>    It's short name is  C:\PROGRA~1\POSTGR~1\9.6\bin\pg_ctl.exe
>
> These short names don't permit spaces or non-printing characters, so
> they can work in situations where the natural name may not.
>
> George
>
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2017-11-08 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07 19:30 Running Windows binaries from non-English folder Yuri Martsinovsky <captainsilver@gmail.com>
2017-11-08 06:56 ` Thomas Kellerer <spam_eater@gmx.net>
2017-11-08 18:09 Re: Running Windows binaries from non-English folder George Neuner <gneuner2@comcast.net>
2017-11-08 19:02 ` Yuri Martsinovsky <captainsilver@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox