Skip to content

Instantly share code, notes, and snippets.

@isccarrasco
Created July 10, 2015 03:15
Show Gist options
  • Save isccarrasco/0f3f41e4b0972dedd848 to your computer and use it in GitHub Desktop.
Save isccarrasco/0f3f41e4b0972dedd848 to your computer and use it in GitHub Desktop.
Script for create a read-only user on PostgreSQL.
CREATE ROLE queryUser WITH NOCREATEDB NOCREATEROLE NOCREATEUSER NOINHERIT NOREPLICATION ENCRYPTED PASSWORD '****' CONNECTION LIMIT 1 LOGIN;
GRANT USAGE ON SCHEMA public TO queryUser;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO queryUser;
@ncabrerax
Copy link

GRANT all privileges on SCHEMA recaudacion to produccion;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment