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
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.
-
ALTER DATABASE name SET TABLESPACE somename; what is this commandNirmani Malee– Nirmani Malee2016年09月27日 06:55:10 +00:00Commented Sep 27, 2016 at 6:55
-
Check the post that I have put in my reply. There the command is explained.Marco– Marco2016年09月27日 07:03:40 +00:00Commented Sep 27, 2016 at 7:03