842
Comment: converted to 1.6 markup
|
888
postgres is definitely not in afs any more
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
See MySQL for list of things that have to be done for any database | See [[MySQL]] for list of things that have to be done for any database |
Line 21: | Line 21: |
---- CategoryOutdated CategoryNeedsWork |
See MySQL for list of things that have to be done for any database (both MySQL and Postgres).
1. Postgres-specific setup
- $dir = /afs/hcoop.net/common/databases/USERNAME/postgres
If $dir does NOT exist:
sudo -u postgres psql -c "CREATE USER USERNAME" template1
- mkdir -p $dir
- chown postgres:postgres "$dir"
- fs setacl -dir $dir -acl postgres write
- fs setacl -dir $dir -acl databases none # (keep out other databases, just in case)
- fs setacl -dir $dir -acl system:backup rl # (should be inherited from parent dir)
sudo -u postgres psql -c "CREATE TABLESPACE user_USERNAME OWNER USERNAME LOCATION '$dir'" template1
When it does, go directly to database creation step:
sudo -u postgres createdb -O USERNAME -D user_USERNAME DBNAME