postgresql: creating database in a specified location
You would need to do this in 2 steps:
- Create Tablespace examples for which you can see in the link
- 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.