setup/postgres/psql_create_database.sql

Sun, 21 Jun 2020 12:32:25 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 21 Jun 2020 12:32:25 +0200
changeset 94
edba952cfc57
parent 16
4e0998805276
permissions
-rw-r--r--

fix: issue form should always include the currently selected versions

universe@16 1 -- Create a database owner role, which is also a privileged user
universe@16 2 create user lightpit_dbo with password 'lpit_dbo_changeme';
universe@2 3
universe@2 4 -- Create the actual (unprivileged) database user
universe@2 5 create user lightpit_user with password 'lpit_user_changeme';
universe@2 6
universe@2 7 -- Create the LightPIT schema
universe@2 8 create schema lightpit authorization lightpit_dbo;
universe@5 9 grant usage on schema lightpit to lightpit_user;
universe@2 10
universe@2 11 -- Grant basic privileges to user (the granting user must be the dbo)
universe@2 12 alter default privileges for role lightpit_dbo in schema lightpit
universe@2 13 grant select, insert, update, delete on tables to lightpit_user;
universe@2 14 alter default privileges for role lightpit_dbo in schema lightpit
universe@2 15 grant usage, select on sequences to lightpit_user;
universe@2 16 alter default privileges for role lightpit_dbo in schema lightpit
universe@2 17 grant execute on functions to lightpit_user;
universe@2 18 alter default privileges for role lightpit_dbo in schema lightpit
universe@2 19 grant usage on types to lightpit_user;
universe@5 20
universe@5 21 -- restrict the search path to the lightpit schema
universe@5 22 alter role lightpit_dbo set search_path to lightpit;
universe@5 23 alter role lightpit_user set search_path to lightpit;

mercurial