restore a table in a database

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

 



How do I restore just a table to a database? I was able to create a backup of the required table from a backup of the database as follows.

I don’t know how to properly restore the backed up table “departments” to the original “sms” database.

 

create a new db

createdb -U postgres smstest

 

restore a backup of the db to the new db

psql -U postgres smstest < /tmp/postgresql-sms-11-24-2008_04-05-database

 

backup up the specific table from the restored db

pg_dump -U postgres -a -t departments smstest > /tmp/smsdepartments

 

The table backup is smsdepartments. How do I restore smsdepartments to the table called departments in the sms database?

 

Thanks

 

Marc

 


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux