0

I have two postgresql database in single 1tb hard disk. Each data base sizes more than 300gb. So now I faced a disk space problem and I bought another 1tb hard disk recently. So I need to move one database into this new hard disk. How can I do that in Ubuntu ????

If I move one database to another drive, postgresql can communicate both harddisks at same time? Can I access both databases in postgresql on master hard.

Sorry for my bad English.

Marco
3,7205 gold badges25 silver badges31 bronze badges
asked Sep 22, 2016 at 12:16

1 Answer 1

0

PostgreSQL has no problem with the data on 2 hard-disks. The best thing that you can do is create a tablespace on your second hard-disk and move one of the databases to this tablespace.

CREATE TABLESPACE somename LOCATION 'directory-on-new-disk';
ALTER DATABASE name SET TABLESPACE somename;

Also see this post: Postgresql: Move database to new tablespace.

If you use LVM then you can also consider to use this to extend the logical volume on which your database is.

answered Sep 22, 2016 at 12:59
2
  • ALTER DATABASE name SET TABLESPACE somename; what is this command Commented Sep 27, 2016 at 6:55
  • Check the post that I have put in my reply. There the command is explained. Commented Sep 27, 2016 at 7:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.