Skip to content

Commit

Permalink
made roles.sql idempotent
Browse files Browse the repository at this point in the history
  • Loading branch information
jberkus committed May 9, 2012
1 parent 8b9c61f commit 073058d
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions sql/roles.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,31 @@ END LOOP;

END;$d$;

-- analyst role, for read-only connections by analytics users
ALTER ROLE analyst CONNECTION LIMIT 10;
ALTER ROLE analyst SET statement_timeout TO '15min';
ALTER ROLE analyst SET work_mem TO '128MB';
ALTER ROLE analyst SET temp_buffers TO '128MB';

-- breakpad group and RW and RO users
-- these are our main users
ALTER ROLE breakpad WITH NOLOGIN;
GRANT breakpad TO breakpad_ro GRANTED BY postgres;
GRANT breakpad TO breakpad_rw GRANTED BY postgres;

-- breakpad_metrics user for nightly batch updates from metrics
GRANT breakpad TO breakpad_metrics GRANTED BY postgres;

-- monitor and processor roles for data processing
GRANT breakpad_rw TO processor GRANTED BY postgres;
GRANT breakpad_rw TO monitor GRANTED BY postgres;
GRANT processor TO monitor GRANTED BY postgres;

-- monitoring group and separate users for ganglia and nagios
ALTER ROLE monitoring WITH NOLOGIN;
GRANT monitoring TO ganglia GRANTED BY postgres;
GRANT monitoring TO nagiosdaemon GRANTED BY postgres;

-- replicator role for replication
ALTER ROLE replicator WITH SUPERUSER;

0 comments on commit 073058d

Please sign in to comment.