Skip to content

Instantly share code, notes, and snippets.

@mmasashi
Last active October 17, 2018 08:57
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mmasashi/5114728 to your computer and use it in GitHub Desktop.
Save mmasashi/5114728 to your computer and use it in GitHub Desktop.
How to create a read-only user on Amazon Redshift. http://awsdocs.s3.amazonaws.com/redshift/latest/redshift-dg.pdf
  • Setup Database
create database [db-name];
revoke all on schema public from public;
create schema [schema-name];
create table [schema-name].[table-name](
  ...
) 
  • Create Read-only User
create user [user-name] password '[password]';
grant usage on schema [schema-name] to [user-name];
alter user [user-name] set search_path to [schema-name];
grant select on table [schema-name].[table-name] to [user-name];
@dshvedchenko
Copy link

I don't think it is necessar
alter user [user-name] set search_path to [schema-name];

@abhayathem
Copy link

very helpful :)

@m-vdb
Copy link

m-vdb commented Apr 6, 2016

I used grant select on all tables in schema [schema-name] to [user-name]; for the last step

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