Re: copy a database
От | David Suela Fernández |
---|---|
Тема | Re: copy a database |
Дата | |
Msg-id | 1093442898.20806.13.camel@yen-lo-wang обсуждение исходный текст |
Ответ на | Re: copy a database (Christopher Browne <cbbrowne@acm.org>) |
Ответы |
Re: copy a database
Re: copy a database Re: copy a database |
Список | pgsql-general |
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. -- David Suela Fernández <dsuela@xsto.info> xsto.info <el acceso a la información>
В списке pgsql-general по дате отправления: