CREATE ROLE specadmin WITH
	LOGIN
	NOSUPERUSER
	NOCREATEDB
	NOCREATEROLE
	INHERIT
	NOREPLICATION
	NOBYPASSRLS
	CONNECTION LIMIT -1
	PASSWORD 'specadmin';

CREATE DATABASE specdata
    WITH
    OWNER = specadmin
    ENCODING = 'UTF8'
    LOCALE_PROVIDER = 'libc'
    CONNECTION LIMIT = -1
    IS_TEMPLATE = False;

ALTER ROLE specadmin IN DATABASE specdata
    SET "TimeZone" TO 'UTC';
ALTER ROLE specadmin IN DATABASE specdata
    SET client_encoding TO 'utf8';
ALTER ROLE specadmin IN DATABASE specdata
    SET default_transaction_isolation TO 'read committed';

GRANT ALL ON DATABASE specdata TO specadmin;
