Search Postgresql Archives

Backup & Restore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have a simple question that I can't find the answer to in the documentation: how do I backup & restore a single database, ie. when going from one cluster to another? I'm fairly comfortable with the command line so I can create and restore backups but things do not always work as expected.

pg_dump -U postgres  -f my_database.dmp -F c my_database

now I want to restore this database to another system where a database with the same name already exists (from production to development):

According to the documentation the options -c and -a can be set on pg_restore

ie.,
pg_restore -U postgres -c -d psytec psytec.dmp

should drop all the tables before recreating them but I get a load of errors: pg_restore: [archiver (db)] Error from TOC entry 1949; 2620 297386 TRIGGER RI_ConstraintTrigger_297386 postgres

using -a to restore data only means fewer errors as pg_restore exits on the first error

Is the only way to drop the target database and recreate an empty one? Or am I simply misreading the docs?

Thanks very much for any help.

Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226




---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux