owner=${owner} \
pass=$(cat ${gnupg.secrets."postgresql/pass/${owner}".path}) \
pg_createdb ${db} >/dev/null
-
+
$PSQL -d "${db}" -AqtX --set ON_ERROR_STOP=1 -f - <<EOF
-- Reallow this to avoid the error:
-- "Couldn't refresh the graph"
GRANT SELECT ON pg_catalog.pg_tablespace TO ${owner};
-- Reallow this to allow pgadmin3
GRANT SELECT ON pg_catalog.pg_user TO ${owner};
-
+
-- Enable PL/PGSQL
CREATE OR REPLACE LANGUAGE plpgsql;
EOF