Skip to content

Instantly share code, notes, and snippets.

View bernaldani's full-sized avatar
🏠
Working from home

Daniel Bernal bernaldani

🏠
Working from home
View GitHub Profile
@bernaldani
bernaldani / gist:18d9405fd83400fe453d02e8f315177e
Created October 10, 2017 14:51
Crear acceso solo lectura Posgresql
-- 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;