5

I have 2 HD partitions - one with SSD and another with regular hard drives.

I have multiple databases (as in logical database, not physical) with 1 data directory. I want the data for 1 of the databases to reside in the SSD partition because it's a database that will have LOT more reads/writes than the other databases. And since the SSD partition is limited in space, I can't store all the databases there, just that one.

Is there a way to configure this in Postgres - is it possible? Is there a tutorial online that I can read? I tried Googling but all the results talk about partitioning tables logically, not across different hard drive partitions.

asked Dec 6, 2013 at 1:32
1
  • 1
    What you need is tablespaces. Commented Dec 6, 2013 at 2:09

1 Answer 1

9

You can create a table space that uses the second partition. Then just alter the database to use that partition.

CREATE TABLESPACE fastspace LOCATION '/mnt/ssdpart';
ALTER DATABASE yourdb SET TABLESPACE fastspace;

See also, http://www.postgresql.org/docs/9.3/interactive/manage-ag-tablespaces.html and http://www.postgresql.org/docs/9.3/interactive/sql-alterdatabase.html

Good luck!

answered Dec 6, 2013 at 2:40

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.