473,749 Members | 2,432 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PostgreSQL upgrade -> fails to start server

Hi,

After a very recent postgresql update, the postmaster failed to start
because of this:

| PANIC: The database cluster was initialized with LC_CTYPE
| 'n****@euro.UTF-8', which is not recognized by setlocale().
| It looks like you need to initdb.

Now I know nl***@euro.UTF-8 is an incorrect locale, I fixed that some
time ago, but because postgresql kept on running, and the machine didn't
reboot in the mean time, I noticed nothing when the new libc's / locales
stopped 'supporting' that (faulty) locale.

To make a long story short: i can't activate that locale again,
therefore the postmaster won't start, and therefore I can't salvage my
databases to re-create them & finish the postgresql upgrade.

Now I found out the binary file data/global/pg_control matches the
faulty locale, so I tried to vi that in a desperate attempt to start the
server, but it failed and I had to restore the original.

Is there some way that I can get to my precious databases?
I fear that downgrading postgresql won't work, because the locale still
isn't available, so it probably won't start either.

Help? :)

I'm running Debian Unstable, libc6/locales 2.3.2, postgresql 7.3.4.

Thanks!
Sander.
--
| A conscience is what hurts when all of your other parts feel so good.
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8 9BDB D463 7E41 08CE C94D

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #1
12 6194
Ok, IIRC the reason you need to initdb is because indexes use your specific
locale to work. Without knowing the locale, indexes can't be used.

That said, it seems to be a bit strict to refuse to start the server.

In any case, there is a program pg_controldata which dumps the current
locale. It may help to determine if you edit pg_control properly.

Once you can start it, pg_dumpall and restart. Ofcourse, if you have
backups...

In any case, as a last resort you can try pgfsck
(http://svana.org/kleptog/pgfsck.html). It ignores your locale and so may be
able to recover some of your data.

Hope this helps,

On Fri, Aug 29, 2003 at 11:58:37AM +0200, Sander Smeenk wrote:
Hi,

After a very recent postgresql update, the postmaster failed to start
because of this:

| PANIC: The database cluster was initialized with LC_CTYPE
| 'n****@euro.UTF-8', which is not recognized by setlocale().
| It looks like you need to initdb.

Now I know nl***@euro.UTF-8 is an incorrect locale, I fixed that some
time ago, but because postgresql kept on running, and the machine didn't
reboot in the mean time, I noticed nothing when the new libc's / locales
stopped 'supporting' that (faulty) locale.

To make a long story short: i can't activate that locale again,
therefore the postmaster won't start, and therefore I can't salvage my
databases to re-create them & finish the postgresql upgrade.

Now I found out the binary file data/global/pg_control matches the
faulty locale, so I tried to vi that in a desperate attempt to start the
server, but it failed and I had to restore the original.

Is there some way that I can get to my precious databases?
I fear that downgrading postgresql won't work, because the locale still
isn't available, so it probably won't start either.

Help? :)

I'm running Debian Unstable, libc6/locales 2.3.2, postgresql 7.3.4.

Thanks!
Sander.
--
| A conscience is what hurts when all of your other parts feel so good.
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8 9BDB D463 7E41 08CE C94D

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
--
Martijn van Oosterhout <kl*****@svana. org> http://svana.org/kleptog/ "All that is needed for the forces of evil to triumph is for enough good
men to do nothing." - Edmond Burke
"The penalty good people pay for not being interested in politics is to be
governed by people worse than themselves." - Plato


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/TzihY5Twig3Ge+Y RAilFAJwJ4KIE+x 6dAB7AgLSYqKVX6 sNp+ACgmr85
Qrlu9lJP1zrpmpc cAsDItaQ=
=xV8S
-----END PGP SIGNATURE-----

Nov 11 '05 #2
Quoting Martijn van Oosterhout (kl*****@svana. org):
Ok, IIRC the reason you need to initdb is because indexes use your specific
locale to work. Without knowing the locale, indexes can't be used.
That said, it seems to be a bit strict to refuse to start the server.
I thought so too. But then I thought maybe the data stored inside the
database is affected by this locale setting too?
In any case, there is a program pg_controldata which dumps the current
locale. It may help to determine if you edit pg_control properly.
It's impossible to edit pg_control by hand with something like a hex
editor because it has checksums to verify it's integrity.

I'd need to create a program that constructs the pg_control internal
structure to change the locale stored inside.
Once you can start it, pg_dumpall and restart.
Ofcourse, if you have backups...
The data is not yet lost. It's still on my disk. It's just that the
postmaster won't start because of this locale-thing. To fix it I need
the postmaster running, and to get the postmaster running, I need to fix
it. It loops :)
In any case, as a last resort you can try pgfsck. It ignores your
locale and so may be able to recover some of your data.
I downloaded pgfsck and ran it over the database. According to pgfsck my
complete database is fscked-up and no data comes out of the tool's
effort. That is, I have not yet tried to turn the hex strings into ascii.
Hope this helps,


I guess I need to find out how to construct my own pg_control file ;)

Sander.
--
| If you look like your passport picture, you probably need the trip.
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8 9BDB D463 7E41 08CE C94D

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/Tz9e1GN+QQjOyU0 RAiRgAJ9LGUHG0u UvqizI5HNRSIpvM X/+SACgi+ty
WxvvZ+WSz35RK45 o8f59nEc=
=xaAP
-----END PGP SIGNATURE-----

Nov 11 '05 #3
Sander Smeenk <ss*******@fres hdot.net> writes:
To make a long story short: i can't activate that locale again,


Why not? Undoing whatever you did to the locale setup seems a lot
easier task than any other option that's open to you.

I would *not* recommend hand-editing pg_control, even if you got the
CRC correct. There is a reason why we put in code to prevent on-the-fly
changes of locale: it corrupts your indexes. You might be able to get
the postmaster to start, but that wouldn't mean you could trust the
output of pg_dump.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 11 '05 #4
Quoting Tom Lane (tg*@sss.pgh.pa .us):
To make a long story short: i can't activate that locale again, Why not? Undoing whatever you did to the locale setup seems a lot
easier task than any other option that's open to you.


The nl***@euro.UTF-8 locale I used 'back then' is incorrect. It's not a
real locale, and the newer versions of libc6 and locales that I have
installed now don't support the generation of this faulty locale.

I would have to figure out what release of libc6 and locales did
generate this faulty locale, and then install that version, just HOPING
that all the other services i'm running still function with that release
of libc6. And because this situation is on my colocated machine, i'd
rather not have it crash just before the weekend :)

And seeing that nl***@euro.UTF-8 was an UTF-8 locale, and nl_NL.UTF-8
(which is correct) is an UTF-8 locale too, I thought that it wouldn't
really hurt much if I tried replacing that value in pg_control.
I would *not* recommend hand-editing pg_control, even if you got the
CRC correct.
It is a desperate attempt to get my data out.
There is a reason why we put in code to prevent on-the-fly
changes of locale: it corrupts your indexes.


Yes, well, it also forbids me to save my data now :)
And theres no --yes-i-know-this-is-stupid-but-please-let-me-do-this option.

Sander.
--
| Wat als je je twee keer half dood schrikt ?
| 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8 9BDB D463 7E41 08CE C94D

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 11 '05 #5
Sander Smeenk <ss*******@fres hdot.net> writes:
Quoting Tom Lane (tg*@sss.pgh.pa .us):
To make a long story short: i can't activate that locale again,
Why not? Undoing whatever you did to the locale setup seems a lot
easier task than any other option that's open to you.
The nl***@euro.UTF-8 locale I used 'back then' is incorrect. It's not a
real locale, and the newer versions of libc6 and locales that I have
installed now don't support the generation of this faulty locale.


If you believe that your new locale is functionally equivalent to the
old (which you'd better, if you're going to risk starting the postmaster
under it), why don't you just make a temporary symlink in
/usr/lib/locale/ ?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #6
Quoting Tom Lane (tg*@sss.pgh.pa .us):
The nl***@euro.UTF-8 locale I used 'back then' is incorrect. It's not a
real locale, and the newer versions of libc6 and locales that I have
installed now don't support the generation of this faulty locale.

If you believe that your new locale is functionally equivalent to the
old (which you'd better, if you're going to risk starting the postmaster
under it), why don't you just make a temporary symlink in
/usr/lib/locale/ ?


I think this locale setup is a bit different with Debian installations.
/usr/lib/locale/ holds no files except for 'locale-archive' which,
according to file, is a PDP11 executable :P

I tried specifying 'nl***@euro.UTF-8 nl_NL.UTF-8' in locale.alias, but
to no extent. It still won't start.

Thanks,
Sander
--
| Junk is something you've kept for years and throw away three weeks
| before you need it.

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 11 '05 #7
In article <20************ ********@freshd ot.net>,
Sander Smeenk <ss*******@fres hdot.net> wrote:
Hi,

After a very recent postgresql update, the postmaster failed to start
because of this:

| PANIC: The database cluster was initialized with LC_CTYPE
| 'n****@euro.UTF-8', which is not recognized by setlocale().
| It looks like you need to initdb.

Is there some way that I can get to my precious databases?


You have the source. Find where it prints this, make it not panic
but continue, recompile, run that server, run psql, drop the indexes,
dump the database.

Mike.
--
RAND USR 16514
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 11 '05 #8
On Fri, Aug 29, 2003 at 06:17:43PM +0200, Sander Smeenk wrote:
Quoting Tom Lane (tg*@sss.pgh.pa .us):
The nl***@euro.UTF-8 locale I used 'back then' is incorrect. It's nota
real locale, and the newer versions of libc6 and locales that I have
installed now don't support the generation of this faulty locale. If you believe that your new locale is functionally equivalent to the
old (which you'd better, if you're going to risk starting the postmaster
under it), why don't you just make a temporary symlink in
/usr/lib/locale/ ?


I think this locale setup is a bit different with Debian installations.
/usr/lib/locale/ holds no files except for 'locale-archive' which,
according to file, is a PDP11 executable :P

I tried specifying 'nl***@euro.UTF-8 nl_NL.UTF-8' in locale.alias, but
to no extent. It still won't start.


The locales in Debian are stored in either:
/usr/lib/locale/en_US
/usr/share/i18n/locales/en_US

pg_dump/restore recommended after.

--
Martijn van Oosterhout <kl*****@svana. org> http://svana.org/kleptog/ "All that is needed for the forces of evil to triumph is for enough good
men to do nothing." - Edmond Burke
"The penalty good people pay for not being interested in politics is to be
governed by people worse than themselves." - Plato


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/T/TJY5Twig3Ge+YRA hvJAJ9Sl3Jpqkf/sL+hbiPbziV94mk LRQCg0Yjm
e5EEhMHA+hgnxd5 2FsvnCsQ=
=LrDF
-----END PGP SIGNATURE-----

Nov 11 '05 #9
On Fri, Aug 29, 2003 at 10:09:15AM -0400, Tom Lane wrote:
Sander Smeenk <ss*******@fres hdot.net> writes:
To make a long story short: i can't activate that locale again,
Why not? Undoing whatever you did to the locale setup seems a lot
easier task than any other option that's open to you.

I would *not* recommend hand-editing pg_control, even if you got the
CRC correct. There is a reason why we put in code to prevent on-the-fly
changes of locale: it corrupts your indexes. You might be able to get
the postmaster to start, but that wouldn't mean you could trust the
output of pg_dump.


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_indexsca n to false. This would at least give you
enough to pg_dump things.

Assuming the locale doesn't affect something else also.

--
Martijn van Oosterhout <kl*****@svana. org> http://svana.org/kleptog/ "All that is needed for the forces of evil to triumph is for enough good
men to do nothing." - Edmond Burke
"The penalty good people pay for not being interested in politics is to be
governed by people worse than themselves." - Plato


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/T/VQY5Twig3Ge+YRA rYAAJ9QjGPJmcgl 0lOTQcGelqwdxOL kKQCgpQgH
kIeS/3kttCHdc6dIfgfp SeI=
=Dx1s
-----END PGP SIGNATURE-----

Nov 11 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8303
by: Bill Kratzer | last post by:
Hi... I am currently working on a Java-based product that is backed by PostgreSQL (among other databases). I have noticed that PostgreSQL appears to truncate column alias names after 31 characters. I have replicated this through JDBC (in Java), PEAR (in PHP), and on the command-line interface (psql). For example (this is from the psql command-line tool):
125
14809
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from software giant such as Microsoft SQL Server, Oracle, and Sybase? Is PostgreSQL reliable enough to be used for high-end commercial application? Thanks
7
2252
by: Peter Eisentraut | last post by:
Greetings. The official PostgreSQL documentation has been translated to German and has been published as a book by verlag moderne industrie/mitp ("PostgreSQL: Das offizielle Handbuch", ISBN 3-8266-1337-6, see <http://www.mitp.de/vmi/mitp/detail/pWert/1337>). I am the translator of this work, but let me assure you I don't get any additional money depending on how much it sells. On the other hand, the publisher has assured me that a...
2
1806
by: Mike Mascari | last post by:
Apparently the Postgres lineage is sufficiently obfuscated to cause people to think that the correct pronunciation/shorthand of PostgreSQL is 'Postgre' and not 'Postgres'. Note the last line in the "What's New in this Version" paragraph: http://www.apple.com/downloads/macosx/unix_open_source/postgresql.html Perhaps all introductory material, press releases, etc. should begin like: PostgreSQL, descendant of Postgres, is a sophisticated
15
2425
by: Manuel Tejada | last post by:
Hello list This is my situation: My box: Pentium III, Red Hat 9.0 I was working fine with PostgreSQL 7.3.2. Recently I decided to upgrade it to PostgreSQL 7.4 installing the twelve rpms I downloaded from ftp://ftp15.us.postgresql.org/binar...dhat/refhat-9/.
14
4117
by: Manuel Tejada | last post by:
Hi My box: RedHat 9.0, Pentium III Recently I upgraded from PostgreSQL 7.3.2 to PostgreSQL 7.4.1. The PostgreSQL 7.3.2's rpms were installed from RehHat CDs The PostgreSQL 7.4.1's rpms I used to upgrade were downloaded from RHEL3 subdirectory (of the mirror ftp://ftp4.ar.postgresql.org/pub/mirrors/postgresql/binary/v7.4.1/redhat/rhel3). The upgrade is working well, even I can connect to PostgreSQL from a PHP
2
1548
by: Adam Williams | last post by:
Hi, as my title states I'm trying to upgrade from 7.2 to 7.3 on redhat linux 9. I've been following the documentation instructions on the website but ran into problems. I searched on google but could not find my answer. On postgresql as user postgres I ran the command pg_dumpall > sroom1 and then after installing 7.3 I ran psql template1 < sroom1 but when I run that after a bunch of grants, revokes, etc, it prints the error: ...
1
2605
by: Frans | last post by:
Hello All, I have just upgrade my postgresql to 7.4.5-2, but I have problem with default value in postgresql 7.4.5-2, everytime I set default value for varchar or timestamp fields, the result value always change to sometihing like this : I set the default value to '1900-01-01 00:00:00' , but the result is '1900-01-01 00:00:00'::timestamp without time zone I've tried to erase the "::timestamp withut time zone" but it didn't work.
1
2423
by: rich | last post by:
I want to upgrade php 4.3.9 and postgresql 7.4.13 on Centos 4.3 to php 5.1.4 and postgresql 8.1.4 using rpms. Has anyone done this?
0
4273
by: nilart | last post by:
Hi , Our current windows application uses postgre 8.1 while next release will be using postgre 8.3 Naturally when application is upgraded ..postgre is expected to upgrade To support this upgrade we will be taking following path: 1) run pgdump & take backup of existing database
0
8997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6079
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4881
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3320
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.