Re: More Code Page wierdness

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Magnus Hagander <mha(at)sollentuna(dot)net>
Cc: pgsql-hackers-win32(at)postgresql(dot)org
Subject: Re: More Code Page wierdness
Date: 2005-01-11 10:05:56
Message-ID: 1105437956.3803.181.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers-win32

On Tue, 2005-01-11 at 10:18 +0100, Magnus Hagander wrote:
> > Spent a few hours today diagnosing some errors on Win32 (on
> > Windows Server 2003). These were, I think, wrongly identified
> > as being Windows Installer problems, so I believe Magnus was
> > chasing his tail also.
>
> I assume you are talking about the "Access Denied" on initdb error that
> David Saunders reported? If so, I erally don't think that specific
> problem has to do with encoding - it happens *before* initdb even
> starts. I think it's two different issues.

Sounds like a different issue, but yes, it was David's problem.

>
> > The problem seemed to be code page related...
> >
> > If you set listen_addresses="*" then the pgsql server doesn't
> > recognise this because * in one code page is different from *
> > in another. It looks like a *, but it isn't...
>
> Yikes!

...top of my most-wierd list.

>
> > Setting listen_addresses to other valid values works just
> > fine....tested with "localhost" using local TCP/IP
> > connection; "localhost, 10.0.0.x"
> > with access from 10.0.0.x...all working fine.
> >
> > Changing the default Language setting to match that of your
> > keyboard is only a temporary workaround, since you can't be
> > sure which code page is in use by any particular application
> > or window. The only way to be sure is to set the default code
> > page to the current locale and reboot, but I'm not sure that
> > catches everything either once things have been edited.
>
> You can log in as the postgres user and change it there.
>
> I've not seen this myself, and I've run on systems in US English and in
> Swedish. But you're saying this occurs if say I have the system default
> set to something that uses Latin1 and then use a different encoding when
> I edit the file? I guess that can be a problem, since notepad doesn't
> let you chose encoding.

That is correct.

> Or are you saying it occurs even if the encodings are the same?

No, the first one.

> One way to solve this would be to keep the file in UTF-8 or something,
> I guess, but that's a fairly major code change... Or find some way to
> make sure it's always saved in whatever encoding postgres expects
> (US-ASCII?)
>
> > These are definitely not Windows Installer problems because
> > it is perfectly valid action to change the Language of a
> > server, at least in Europe. The server should work, no matter
> > what any installer did/does....just the same as the server
> > knows not to start if the installer incorrectly set up the
> > rights of the instance owning userid.
>
> Definitly. The issue appears to be that you have an invalid encoding in
> the config file. How exaclty did you get there - did the installer edit
> it into the wrong encoding, or did you edit it manually? Using what
> editor?

Looks like Windows Server 2003 was setup with "English - United States",
then PostgreSQL was installed using "English -UK", and the system was
being edited with a UK keyboard (which shows things like British pound,
hash and star all in their correct (!) place ...i.e. different to US).

--
Best Regards, Simon Riggs

In response to

Browse pgsql-hackers-win32 by date

  From Date Subject
Next Message Simon Riggs 2005-01-11 10:11:13 Re: More Code Page wierdness
Previous Message Rangarajan 2005-01-11 09:26:25 Bugs