I'm running a PostgreSQL server with 2 tablespaces: 'ssd' and 'hdd'. The first contains databases that need to be queried quickly, and is located on a single SSD that is not redundant in any way (no RAID). I don't care if I lose these databases to a disk failure. By contrast, the 'hdd' tablespace is located on a RAID array and contains critical databases that need to survive a disk failure.

Question: if my SSD fails and PostgreSQL loses the 'ssd' tablespace completely (or it becomes corrupt/unstable), will databases in 'hdd' continue functioning normally? Or will the entire server experience issues?

  • @a_horse_with_no_name: would you like to make that an answer, maybe with a little more info? Thanks.
    – kontextify
    Oct 6, 2016 at 18:14

1 Answer 1


I can't describe this better than the manual does


Even though located outside the main PostgreSQL data directory, tablespaces are an integral part of the database cluster and cannot be treated as an autonomous collection of data files. They are dependent on metadata contained in the main data directory, and therefore cannot be attached to a different database cluster or backed up individually. Similarly, if you lose a tablespace (file deletion, disk failure, etc), the database cluster might become unreadable or unable to start. Placing a tablespace on a temporary file system like a RAM disk risks the reliability of the entire cluster.

Or this blog post

You can’t just throw a tablespace away and have the rest of the database system keep on working.

Most importantly, the write-ahead log (WAL) that provides PostgreSQL’s crash safety is stored in pg_xlog, and is shared across all tablespaces. PostgreSQL expects to be able to replay this log in order and without errors after a crash or shutdown. Until the log has replayed, the database is assumed to be in an unsafe state and connections will be refused

  • So would setting up another cluster on the same machine be a solution?
    – kontextify
    Oct 6, 2016 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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