Re: copy a database

From: Chris Travers <chris(at)metatrontech(dot)com>
To: dsuela(at)xsto(dot)info, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: copy a database
Date: 2004-08-25 14:56:39
Message-ID: 412CA8A7.4020907@metatrontech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)xsto(dot)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.
>
>
>

Attachment Content-Type Size
chris.vcf text/x-vcard 127 bytes

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marco Colombo 2004-08-25 15:01:17 Re: Question about SQL statement error
Previous Message Dino Vliet 2004-08-25 14:53:45 help with trigger