To create a Read only user
Access postgres console:
sudo -u postgres psql
Create user and grant read access to the database
CREATE USER user_name WITH ENCRYPTED PASSWORD 'your_password';
CREATE DATABASE user_name;
To create a Read only user
Access postgres console:
sudo -u postgres psql
Create user and grant read access to the database
CREATE USER user_name WITH ENCRYPTED PASSWORD 'your_password';
CREATE DATABASE user_name;
# https://gist.github.com/francisco-rojas/db0fb04ed6aa509acc18 | |
# https://dev.firmafon.dk/blog/drat-ruby-has-a-double-splat/ | |
# http://blog.simplificator.com/2015/03/20/ruby-and-the-double-splat-operator/ | |
# http://chriszetter.com/blog/2012/11/02/keyword-arguments-in-ruby-2-dot-0/ | |
# ------------------------------------------------------Method Definition----------------------------------------------------- | |
puts "\n---Method Definition---\n" | |
def say(what, *people) | |
people.each { |person| puts "#{person}: #{what}" } | |
end | |
say "Hello!", "Alice", "Bob", "Carl" |
# create user with password
CREATE USER read_user WITH ENCRYPTED PASSWORD 'password';
# grant access to existing tables
GRANT CONNECT ON DATABASE cpu TO read_user;
GRANT USAGE ON SCHEMA public TO read_user;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO read_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public to read_user;
Images are the building blocks of the Docker world. You launch your containers