Question

I have created a tablespace named hdd_tablespace and I wan't all new databases to be automatically created there. Basically when I execute:

CREATE DATABASE FOO; 

I want this database to be created in hdd_tablespace.

I have updated postgresql.conf with:

 default_tablespace = 'hdd_tablespace' 

However, new databases are still created in pg_default.

Was it helpful?

Solution

Actually it turned out I had also to update template1 database that is a template database.

I had to;

ALTER DATABASE template1 SET TABLESPACE hdd_tablespace; 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top