pg_dump tabelle weglassen

hallo zusammen,

ich muss von einem DB-Server ein Backup auf einen anderen Rechner ziehen. Ich mache das momentan per :

pg_dump -h quelle -U user dbname | psql -h ziel -U user dbname.

Das funktioniert auch sehr gut. Ich möchte jetzt aber von der Quelldatenbank eine oder mehrere Tabellen beim dump weglassen

Mit pg_dump nicht möglich, oder ?

cu, stefan

Hallo Stefan,

Auszug aus der Doku:

-t table
--table=table
Dump data for table only. It is possible for there to be multiple tables with the same name in different schemas; if that is the case, all matching tables will be dumped. Specify both --schema and --table to select just one table.

Note: In this mode, pg_dump makes no attempt to dump any other database objects that
the selected table may depend upon. Therefore, there is no guarantee that the results of a single-table dump can be successfully restored by themselves into a clean database.

Bei vielen Tabellen macht die Anwendung dieser Option aber keinen Sinn. Da ist es einfacher, nach dem Import der Daten, die wenigen nicht benötigten Tabellen wieder von Hand zu löschen.

Nach Beendigung des Import solltest Du VAKUUM starten!



mfg

fristo