postgresql: creating database in a specified location postgresql: creating database in a specified location postgresql postgresql

postgresql: creating database in a specified location


You would need to do this in 2 steps:

  1. Create Tablespace examples for which you can see in the link
  2. Create Database

When you create tablespace you set it's location and then you can create multiple databases in the same tablespace if you choose to.


CREATE TABLESPACE fastspace LOCATION '/mnt/sda1/postgresql/data';

See the chapter about tablespaces in the manual.