postgres
November 30, 2016
🔗Read only user
Create user first:
CREATE USER theuser WITH PASSWORD 'secret';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO theuser;
GRANT CONNECT ON DATABASE mydb TO dbuser;
Test:
psql -h host -U theuser mydb
To see the list of tables:
mydb=>\d+