Databases on separate filesystems

Started by Campano, Troyalmost 22 years ago1 messagesgeneral
Jump to latest
#1Campano, Troy
Troy.Campano@LibertyMutual.com

I need to have each one of my PostgreSQL databases put on a separate
filesystem.

I wanted to do the following...can someone verify that this will work?

1) Create the following environment variables:
a. export PGDATA01=/filesystem1
b. export PGDATA02=/filesystem2
c. export PGDATA03=/filesystem3

2) Run the following commands at UNIX prompt:
a. initlocation /filesystem1
b. initlocation /filesystem2
c. initlocation /filesystem3

3) Restart my postgresql server (to pick up the new environment
variables)

4) Then when I create databases I would do this:
a. CREATE DATABASE mydb01 WITH LOCATION = 'PGDATA01';
b. CREATE DATABASE mydb02 WITH LOCATION = 'PGDATA02';
c. CREATE DATABASE mydb02 WITH LOCATION = 'PGDATA03';

Is this correct to get databases created on separate filesystems?

Thank you!

Troy Campano