init_db 459 B

12345678910111213141516171819
  1. #! /bin/sh
  2. set -e
  3. set -u
  4. . ./init_vars
  5. psql -d postgres <<EOT
  6. CREATE USER dak CREATEROLE;
  7. CREATE ROLE ftpmaster WITH ROLE dak;
  8. CREATE ROLE ftpteam WITH ROLE ftpmaster;
  9. CREATE ROLE ftptrainee WITH ROLE ftpmaster, ftpteam;
  10. CREATE DATABASE ${PGDATABASE} WITH OWNER dak TEMPLATE template0 ENCODING 'SQL_ASCII' LC_COLLATE 'C' LC_CTYPE 'C';
  11. \c ${PGDATABASE}
  12. CREATE EXTENSION IF NOT EXISTS plpgsql;
  13. CREATE EXTENSION IF NOT EXISTS debversion;
  14. EOT