Skip to content

Instantly share code, notes, and snippets.

@babo
Last active July 6, 2016 12:08
Show Gist options
  • Save babo/d06e37e3e4073fd116606dd208bd1545 to your computer and use it in GitHub Desktop.
Save babo/d06e37e3e4073fd116606dd208bd1545 to your computer and use it in GitHub Desktop.
Minimal example how to create a read only group and a time limited user in Redshift. In the example the password is defined with MD5 hash. To generate the actual value you need to concatenate the word md5 with the md5 hash of a composite string, the concatenation of the actual password and the username. For reference the password at this example…
CREATE GROUP read_only;
REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM GROUP read_only;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO GROUP read_only;
CREATE USER
time_limited_reader
WITH
PASSWORD 'md5b3d32f5a247d71dd338a1effa3976ede'
IN GROUP read_only
VALID UNTIL '2016-07-19'
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment