Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a PostgreSQL database living on an external hard disk (RAID0 via Thunderbolt). So far I accessed it from a PostgreSQL server running on my MacBook Pro. As my work on this database is getting more and more intensive the queries are getting more and more complex, too. Therefore I'd like to use my brand spanking new iMac from now on.

My question is: Can I somehow tell the new PostgreSQL server (running on the iMac) to use the data that is already living in the tablespace on the external disk? Or will I have to export & import all the data manually (pg_dump, pg_restore)?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I strongly recommend doing a dump and reload.

Don't put tablespaces on removable media, it doubles your chances of data loss. If either the main database on the main disk or the removable media fails / is lost, your data's gone. A tablespace cannot be read without the database it's from.

share|improve this answer
    
Thank you for your reply. I opted for the dump/restore. I appreciate the comment about the storage of tablespaces on external media, but currently (due to the sheer size of my DB) there's no way around it, I'm afraid... –  Sam Wise Aug 16 '13 at 6:10
    
@SamWise Then make very, very sure you have good backups. Take regular pg_dump backups and store them somewhere. Otherwise sooner or later you will lose your data with a setup like you have. –  Craig Ringer Aug 16 '13 at 6:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.