Re: copy a database

Поиск
Список
Период
Сортировка
От Chris Travers
Тема Re: copy a database
Дата
Msg-id 412CA8A7.4020907@metatrontech.com
обсуждение исходный текст
Ответ на Re: copy a database  (David Suela Fernández <dsuela@xsto.info>)
Список pgsql-general
Have you tried pg_dump --no-owner in order to avoid getting the
ownership information?

David Suela Fernández wrote:

>El mié, 25-08-2004 a las 14:58, Christopher Browne escribió:
>
>
>>In an attempt to throw the authorities off his trail, dsuela@xsto.info (David Suela Fernández) transmitted:
>>
>>
>>>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".
>>>
>>>
>>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 $table $SOURCEDB | psql -p $NEWPORT $NEWDB
>>done
>>
>>
>
>The problem is that pg_dump always give me the next error:
>
>pg_dump: SQL command failed
>pg_dump: Error message from server: ERROR:  relation "pg_user" does not exist
>pg_dump: The command was: SELECT (SELECT usename FROM pg_user WHERE usesysid = datdba) as dba,
pg_encoding_to_char(encoding)as encoding, datpath FROM pg_database WHERE datname = 'ez3' 
>
>I have the db scheme (tables and basic data), but what i need is the new
>data of the db. I can access the db and make queries.
>
>I think i'll make a script to pass data from the corrupt database to the
>new one.
>
>
>


Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: Aggregate query for multiple records
Следующее
От: Marco Colombo
Дата:
Сообщение: Re: Question about SQL statement error