复制数据库 [英] copy a database

查看:92
本文介绍了复制数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!


是否可以将一个数据库从一个postgres服务器复制/迁移到

其他只复制/ var / lib /中的文件postgres / data /?


我不能使用pg_dump,因为它给了我一个错误。我认为比postgres的

安装是腐败的,因为它给了我很多错误

喜欢ERROR:relationpg_catalog.pg_user"不存在。


谢谢,


Suela。

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

提示7:别忘了增加你的可用空间地图设置

Hi!

Is it possible to copy/migrate one database from one postgres server to
other copying just the files in /var/lib/postgres/data/ ?

I can''t use pg_dump because it give me an error. I think than the
instalation of postgres is corrupt because it give me a lot of error
like "ERROR: relation "pg_catalog.pg_user" does not exist".

Thanks,

Suela.
---------------------------(end of broadcast)---------------------------
TIP 7: don''t forget to increase your free space map settings

推荐答案

试图抛弃当局, ds****@xsto.info (DavidSuelaFernández)转发:
In an attempt to throw the authorities off his trail, ds****@xsto.info (David Suela Fernández) transmitted:
是否可以从一个postgres服务器复制/迁移一个数据库到
其他只复制/ var / lib / postgres / data /中的文件?

我可以'不要使用pg_dump因为它给了我一个错误。我认为比postgres的安装是腐败的,因为它给了我很多错误
像ERROR:relationpg_catalog.pg_user"不存在。
Is it possible to copy/migrate one database from one postgres server to
other copying just the files in /var/lib/postgres/data/ ?

I can''t use pg_dump because it give me an error. I think than the
instalation of postgres is corrupt because it give me a lot of error
like "ERROR: relation "pg_catalog.pg_user" does not exist".




从损坏的数据库中复制文件只会给你一个_second_

损坏的数据库。


如果它已损坏,那么你能做的最好的事情就是从数据库中获取你可以获得的数据,然后将它放入一个新的数据库中。


您可能会尝试将其逐表转储:


表格中的表格__ other_table; do

pg_dump -p



Copying files from a corrupted database will just get you a _second_
corrupt database.

If it''s corrupted, then the best you can do is to get what data you
can out of the database, and put it into a NEW database.

What you might try would be to dump it table by table:

for table in this_table that_table other_table; do
pg_dump -p


SOURCEPORT -t
SOURCEPORT -t


table


这篇关于复制数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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