1#!/bin/bash
 2
 3# Lock down most default privileges from a cluster
 4
 5psql -U postgres postgres -c "REVOKE ALL PRIVILEGES ON DATABASE postgres FROM public"
 6psql -U postgres postgres -c "REVOKE ALL PRIVILEGES ON DATABASE template1 FROM public"
 7psql -U postgres postgres -c "REVOKE ALL PRIVILEGES ON DATABASE template0 FROM public"
 8psql -U postgres postgres -c "DROP SCHEMA public"
 9<<<hidden due to potential security issue>>>
10psql -U postgres postgres -c "GRANT CONNECT ON DATABASE postgres TO creator"
11psql -U postgres template1 -c "DROP SCHEMA public"