-- Create pmm database with correct schema ownership -- Assumes roles already created with create-roles.psql -- lpsql pmm -U postgres -f thisfile CREATE DATABASE "pmm" OWNER "pmm.owner"; \c pmm DROP SCHEMA public; \c - pmm.owner REVOKE ALL ON DATABASE "pmm" FROM PUBLIC; GRANT CREATE ON DATABASE "pmm" TO "pmm.dataman"; GRANT CONNECT ON DATABASE "pmm" TO "pmm.read"; \c - pmm.dataman CREATE SCHEMA public; REVOKE ALL ON SCHEMA public FROM PUBLIC; GRANT USAGE ON SCHEMA public TO "pmm.read";