CREATE ROLE re3gistry LOGIN PASSWORD 're3gistry'
      VALID UNTIL 'infinity';
CREATE DATABASE re3gistry
    WITH
    OWNER = re3gistry
    ENCODING = 'UTF8'
    LC_COLLATE = 'en_US.utf8'
    LC_CTYPE = 'en_US.utf8'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1
    IS_TEMPLATE = False;

ALTER DATABASE re3gistry
    SET search_path TO data, public;

ALTER DEFAULT PRIVILEGES FOR ROLE postgres
GRANT INSERT, SELECT, UPDATE, DELETE ON TABLES TO re3gistry;

ALTER DEFAULT PRIVILEGES FOR ROLE postgres
GRANT SELECT, USAGE ON SEQUENCES TO re3gistry;