Skip to content

Instantly share code, notes, and snippets.

View zerobatu's full-sized avatar

Claudio Alvarado zerobatu

  • Santiago, Chile
View GitHub Profile
@zerobatu
zerobatu / postgresql_configuration_on_ubuntu_for_rails.md
Created June 11, 2018 21:09 — forked from p1nox/postgresql_configuration_on_ubuntu_for_rails.md
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@zerobatu
zerobatu / read-access.sql
Last active May 18, 2018 19:54 — forked from oinopion/read-access.sql
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;