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.

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.

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

Your Answer

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

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