Обсуждение: Re: [GENERAL] Installin Postgres

Поиск
Список
Период
Сортировка

Re: [GENERAL] Installin Postgres

От
Bruce Momjian
Дата:
Tom Lane wrote:
> "Mario Caspari" <mariocaspari@salo-ag.de> writes:
> > It compiled and installed well -I thought. But I can't start the postmaster
> > service with the error message:
> > Failed to initialize lc_messages to ��
> > 'Fatal invalid value for option LC_MESSAGES'
>
> You apparently have something weird in your locale environment.  I'd
> suggest editing postgresql.conf to set the LC_xxx variables (look at
> the bottom) to 'C', or at least something supported on your platform.

Tom, are we moving to a C locale by default for 7.4?

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073 



Re: [GENERAL] Installin Postgres

От
Tom Lane
Дата:
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Tom, are we moving to a C locale by default for 7.4?

I suggested it, but I'm not sure if there was consensus or not.
        regards, tom lane



Re: [GENERAL] Installin Postgres

От
"scott.marlowe"
Дата:
On Tue, 6 May 2003, Tom Lane wrote:

> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Tom, are we moving to a C locale by default for 7.4?
> 
> I suggested it, but I'm not sure if there was consensus or not.

Please do.



Re: [GENERAL] Installin Postgres

От
Tom Lane
Дата:
"scott.marlowe" <scott.marlowe@ihs.com> writes:
> On Tue, 6 May 2003, Tom Lane wrote:
>> Bruce Momjian <pgman@candle.pha.pa.us> writes:
>>> Tom, are we moving to a C locale by default for 7.4?
>> 
>> I suggested it, but I'm not sure if there was consensus or not.

> Please do.

Peter lodged what I think was an objection:
http://archives.postgresql.org/pgsql-hackers/2003-04/msg00727.php

but he didn't address anything but the speed issue.  What we are seeing
is that on several platforms, the default locale settings are just plain
broken --- ie, setlocale() barfs on the locale value that the system
environment provides.  There was discussion before about this, but
IIRC we concluded that initdb could not easily detect the problem.

On balance I think we should default to C locale rather than whatever
random junk is in initdb's environment.  Perhaps "initdb --use-locale"
should be required to get the current behavior?
        regards, tom lane



Re: [GENERAL] Installin Postgres

От
Andrew Sullivan
Дата:
On Tue, May 06, 2003 at 11:34:19PM -0400, Tom Lane wrote:

> random junk is in initdb's environment.  Perhaps "initdb --use-locale"
> should be required to get the current behavior?

Yes.  From the point of view of an administrator, the current
behaviour is the worst possible one, because you can find yourself
with a real database before you realise what's happened.  Then you
need to do initdb to recover.  

What's worse, it's not obvious from looking at the encoding of the
database what the problem might be.  If you know about this, of
course, then you know what to do.  But someone inexperienced with
Postgres (who, for instance, is a new developer working on, say, a
registry database ;-) might easily spend quite a bit of time fooling
around with optimisations trying to fix a problem which wouldn't be
there if only the locale had been set correctly.

A

-- 
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8                                        +1 416 646 3304
x110



Re: [GENERAL] Installin Postgres

От
Peter Eisentraut
Дата:
Tom Lane writes:

> What we are seeing is that on several platforms, the default locale
> settings are just plain broken --- ie, setlocale() barfs on the locale
> value that the system environment provides.  There was discussion before
> about this, but IIRC we concluded that initdb could not easily detect
> the problem.

It could be detected if we rewrote parts of initdb in C.  I was sort of
hoping that that would come out of the Windows port.  If not, then I can
write a small helper program that checks the locale during initdb.

-- 
Peter Eisentraut   peter_e@gmx.net



Re: [GENERAL] Installin Postgres

От
Tom Lane
Дата:
Peter Eisentraut <peter_e@gmx.net> writes:
> Tom Lane writes:
>> What we are seeing is that on several platforms, the default locale
>> settings are just plain broken --- ie, setlocale() barfs on the locale
>> value that the system environment provides.  There was discussion before
>> about this, but IIRC we concluded that initdb could not easily detect
>> the problem.

> It could be detected if we rewrote parts of initdb in C.  I was sort of
> hoping that that would come out of the Windows port.

True, I would think it will *have to* come out of the Windows port.
(Bruce, what does the PeerDirect patch do about initdb?)

I still think that on balance it'd be best to default to C locale,
though.  We are certainly not going to be able to fix all the underlying
problems in time for 7.4.  Once non-C locales are not a significant hit
on performance or reliability, then it would be time to default to
environment locale.
        regards, tom lane



Re: [GENERAL] Installin Postgres

От
Bruce Momjian
Дата:
Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Tom Lane writes:
> >> What we are seeing is that on several platforms, the default locale
> >> settings are just plain broken --- ie, setlocale() barfs on the locale
> >> value that the system environment provides.  There was discussion before
> >> about this, but IIRC we concluded that initdb could not easily detect
> >> the problem.
> 
> > It could be detected if we rewrote parts of initdb in C.  I was sort of
> > hoping that that would come out of the Windows port.
> 
> True, I would think it will *have to* come out of the Windows port.
> (Bruce, what does the PeerDirect patch do about initdb?)

I was just talking to Jan about this.  What PeerDirect did was to run
initdb on Intel Unix, and transfer that file to Win32 and copy it to the
data directory during initdb.  SRA actually wrote initdb in C and used
that.

If someone wants to work on that, I will get permission to distribute
the SRA initdb.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073