Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

command to give readonly access to a postgres sql user

sudo -u postgres psql
CREATE USER username WITH PASSWORD 'your_password';
GRANT CONNECT ON DATABASE database_name TO username;
GRANT USAGE ON SCHEMA schema_name TO username;
GRANT SELECT ON ALL TABLES IN SCHEMA schema_name TO username;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name
GRANT SELECT ON TABLES TO username;
Source by tableplus.com #
 
PREVIOUS NEXT
Tagged: #command #give #readonly #access #postgres #sql #user
ADD COMMENT
Topic
Name
5+6 =