PostgreSQL升级 - >无法启动服务器 [英] PostgreSQL upgrade -> fails to start server

查看:86
本文介绍了PostgreSQL升级 - >无法启动服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




在最近的postgresql更新后,邮件管理员无法启动

因为:


| PANIC:数据库集群已初始化为LC_CTYPE

| ''nS@euro.UTF-8'',setlocale()无法识别。

|看起来你需要initdb。


现在我知道 nl *** @ euro.UTF -8是一个不正确的语言环境,我修复了一些

的时间,但因为postgresql一直在运行,而且机器没有&b $ b重新启动时间,当新的libc'/ locales

停止''支持'那个(有缺陷的)语言环境时,我什么都没注意到。


要做多久故事简短:我不能再激活那个地方,

因此邮政局长不会开始,因此我不能打捞我的

数据库来重新开始 - 创造他们&完成postgresql升级。


现在我发现二进制文件data / global / pg_control与

错误的语言环境匹配,所以我试着在一个绝望的尝试启动

服务器,但它失败了,我不得不恢复原来的。


有什么方法可以到达我宝贵的数据库?

我担心降级postgresql不会工作,因为语言环境仍然无法使用,所以它可能也不会开始。 />

帮助? :)


我正在运行Debian Unstable,libc6 / locales 2.3.2,postgresql 7.3.4。


谢谢!

桑德。

-

|当你所有其他部分都感觉良好时,良心就会受到伤害。

| 1024D / 08CEC94D - 34B3 3314 B146 E13C 70C8 9BDB D463 7E41 08CE C94D


------------------------ ---(播出结束)---------------------------

提示4:不要''kill -9''postmaster

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

推荐答案

好的,IIRC你需要initdb的原因是因为索引使用你的特定

语言环境可以正常工作。在不知道区域设置的情况下,不能使用索引。


也就是说,拒绝启动服务器似乎有点严格。


在任何情况下,都有一个程序pg_controldata转储当前的

语言环境。确定你是否正确编辑pg_control可能会有所帮助。


一旦你可以启动它,pg_dumpall并重启。当然,如果你有

备份...


无论如何,作为最后的手段,你可以尝试pgfsck

http://svana.org/kleptog/pgfsck.html) 。它会忽略你的语言环境,因此可能会恢复你的部分数据。


希望这会有所帮助,


在星期五,2003年8月29日上午11:58:37 +0200,Sander Smeenk写道:
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:


在最近的postgresql更新后,邮件管理员失败了因为这个开始


| PANIC:使用LC_CTYPE
|初始化数据库集群''nS@euro.UTF-8'',setlocale()无法识别。
|看起来你需要initdb。

现在我知道 nl***@euro.UTF -8是一个不正确的语言环境,我修复了一些
时间之前,但因为postgresql一直在运行,并且机器没有在同一时间重启,我没注意到新的libc'的时候/ locales
停止''支持''那个(错误的)语言环境。

总而言之:我不能再激活那个语言环境了,因此邮政局长不会开始,因此我无法挽救我的
数据库来重新创建它们。完成postgresql升级。

现在我发现二进制文件data / global / pg_control与
错误的语言环境匹配,所以我试图vi那个绝望的尝试启动
服务器,但它失败了,我不得不恢复原来的。

有什么方法可以访问我宝贵的数据库吗?
我担心降级postgresql不会工作,因为现场仍然无法使用,所以它可能也不会开始。

帮助? :)

我正在运行Debian Unstable,libc6 / locales 2.3.2,postgresql 7.3.4。

谢谢!
Sander。
-
|当你所有的其他部分感觉很好时,良心就会受到伤害。
| 1024D / 08CEC94D - 34B3 3314 B146 E13C 70C8 9BDB D463 7E41 08CE C94D

---------------------------(广播结束)---------------------------
提示4:不要'杀'-9'' postmaster


-

Martijn van Oosterhout< kl ***** @ svana.org> http://svana.org/kleptog/ 部队所需要的一切邪恶胜利是为了让人无所作为。 - 爱德蒙伯克
好人为不参与政治而付出的代价是由比自己更糟糕的人管理。 - 柏拉图
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 -----

版本:GnuPG v1.0.6(GNU / Linux)

评论:有关信息,请参阅 http://www.gnupg.org


iD8DBQE / TzihY5Twig3Ge + YRAilFAJwJ4KIE + x6dAB7AgLSYqKVX6sNp + A Cgmr85

Qrlu9lJP1zrpmpccAsDItaQ =

= xV8S

-----结束PGP SIGNATURE -----



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

iD8DBQE/TzihY5Twig3Ge+YRAilFAJwJ4KIE+x6dAB7AgLSYqKVX6sNp+A Cgmr85
Qrlu9lJP1zrpmpccAsDItaQ=
=xV8S
-----END PGP SIGNATURE-----


引用Martijn van Oosterhout(kl*****@svana.org) :
Quoting Martijn van Oosterhout (kl*****@svana.org):
好的,IIRC你需要initdb的原因是因为索引使用你的特定
语言环境来工作。在不知道区域设置的情况下,不能使用索引。
也就是说,拒绝启动服务器似乎有点严格。


我也这么认为。但后来我想也许存储在

数据库中的数据也会受到这种语言环境设置的影响?

无论如何,有一个程序pg_controldata转储当前的

手动编辑pg_control是不可能的,因为它有一个校验和来验证它的完整性。 />

我需要创建一个程序来构造pg_control内部

结构来改变存储在里面的语言环境。

一旦你可以启动它,pg_dumpall并重启。
当然,如果你有备份...


数据尚未丢失。它还在我的磁盘上。只是因为这种语言环境,

postmaster不会开始。为了解决这个问题,我需要运行postmaster的
,为了让postmaster运行,我需要修复

它。它循环:)

在任何情况下,作为最后的手段,你可以尝试pgfsck。它忽略了您的语言环境,因此可能能够恢复您的一些数据。


我下载了pgfsck并在数据库上运行它。根据pgfsck我的

完整的数据库是fscked-up并且没有数据来自该工具的

努力。也就是说,我还没有尝试将十六进制字符串转换为ascii。

希望这会有所帮助,
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,




我想我需要找到如何构建我自己的pg_control文件;)


Sander。

-

|如果你看起来像你的护照照片,你可能需要旅行。

| 1024D / 08CEC94D - 34B3 3314 B146 E13C 70C8 9BDB D463 7E41 08CE C94D


-----开始PGP签名-----

版本:GnuPG v1.2.3(GNU / Linux)

iD8DBQE / Tz9e1GN + QQjOyU0RAiRgAJ9LGUHG0uUvqizI5HNRSIpvMX / + SACgi + ty

WxvvZ + WSz35RK45o8f59nEc =

= xaAP

-----结束PGP签名-----



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+QQjOyU0RAiRgAJ9LGUHG0uUvqizI5HNRSIpvMX/+SACgi+ty
WxvvZ+WSz35RK45o8f59nEc=
=xaAP
-----END PGP SIGNATURE-----


Sander Smeenk< ss *** ****@freshdot.net>写道:
Sander Smeenk <ss*******@freshdot.net> writes:
简而言之:我不能再激活那个地方,
To make a long story short: i can''t activate that locale again,




为什么不呢?撤消对语言环境设置所做的任何事情似乎比任何其他对你开放的选项更容易实现。


我会*不*推荐手工编辑pg_control,即使你有正确的

CRC。我们有一个原因可以放入代码来防止实时更改区域设置:它会破坏您的索引。你可能能够得到邮政局长的开始,但这并不意味着你可以信任pg_dump的

输出。


问候,tom lane


---------------------------(...结束广播)---------------------------

提示1:订阅和取消订阅命令转到 ma ******* @ postgresql.org



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*******@postgresql.org


这篇关于PostgreSQL升级 - &gt;无法启动服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆