Создание суперюзера
CREATE ROLE username WITH LOGIN SUPERUSER PASSWORD 'userpassword';
Создание юзера
CREATE USER username with PASSWORD 'userpassword';
Присвоить права только на чтение БД
GRANT CONNECT ON DATABASE database_name TO username; GRANT USAGE ON SCHEMA public TO username; GRANT SELECT ON ALL TABLES IN SCHEMA public TO username; GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO username;