Re: PostgreSQL upgrade -> fails to start server - Mailing list pgsql-general

From Sander Smeenk
Subject Re: PostgreSQL upgrade -> fails to start server
Date
Msg-id 20030903205930.GG24400@freshdot.net
Whole thread Raw
In response to Re: PostgreSQL upgrade -> fails to start server  (Sander Smeenk <ssm+pgsql@freshdot.net>)
List pgsql-general
Quoting Sander Smeenk (ssm+pgsql@freshdot.net):

> > Postgres already has a -P option to disable system indexes. Would it be
> > feasable to have a safe mode so that if your locale is broken it sets that
> > flag and also sets enable_indexscan to false. This would at least give you
> > enough to pg_dump things.
> Also see my post to Miquel on this list. I'd really like to see such an
> option. Even though i'll try hard not to have this problem ever again.
> So. I'll be hacking postgresql sources today ;)

Well, not really that day, but today I hacked postgresql :)

Line 2261 in src/backend/access/transam/xlog.c changed from

-    if (setlocale(LC_CTYPE, ControlFile->lc_collate) == NULL)

to

+    if (setlocale(LC_CTYPE, "nl_NL.UTF-8") == NULL)

rebuilt the debian package, made backups, installed it and:

-rw-r--r--    1 postgres postgres  8461201 Sep  3 22:38 db.all.sql

The dump looks all normal! Guess I was lucky that the 'wrong' locale the
db was initialised with was also 100% nl_NL.UTF-8 aparently :)

I'll go re-create the database then, and try to import the dump.

Thanks everyone for all the ideas!
Sander.
--
| I must consider my sins...
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8  9BDB D463 7E41 08CE C94D

Attachment

pgsql-general by date:

Previous
From: "Dann Corbit"
Date:
Subject: Re: delivering database stand-alone
Next
From: Bjørn T Johansen
Date:
Subject: Re: Tomcat Connection Pool?