Understanding tablespaces

PostgreSQL introduced the concept of tablespaces in version 8. In PostgreSQL, a tablespace is a link to a location in the filesystem, that is, a directory. It's a container to hold all other objects, such as tables, indexes, and so on.

There are many situations in which such a feature, storing data in a location other than the default location, could be useful. One scenario when we might want to use tablespaces is when we run out of space on the partition in which we initialized the database cluster. Another scenario could be that we know the usage patterns of different databases/objects and want to move specific objects to a different disk for performance reasons. A set of frequently and heavily accessed objects could ...

Get PostgreSQL for Data Architects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.