Quantcast
Channel: How do you create a read-only user in PostgreSQL? - Stack Overflow
Browsing latest articles
Browse All 14 View Live

Answer by Maulik Boghara for How do you create a read-only user in PostgreSQL?

DB Tool: PGAdmin 4CREATE USER readonly_user2 WITH PASSWORD 'Pass@123'; -- readonly_user2 = UserName, Pass@123 = PasswordGRANT CONNECT ON DATABASE employeedb TO readonly_user2; -- employeedb = Your...

View Article



Answer by Laurenz Albe for How do you create a read-only user in PostgreSQL?

From PostgreSQL v14 on, you can do that simply by granting the predefined pg_read_all_data role:GRANT pg_read_all_data TO xxx;

View Article

Answer by Viktor Viktor for How do you create a read-only user in PostgreSQL?

CREATE USER username SUPERUSER password 'userpass';ALTER USER username set default_transaction_read_only = on;

View Article

Answer by thomi_ch for How do you create a read-only user in PostgreSQL?

I read trough all the possible solutions, which are all fine, if you remember to connect to the database before you grant the things ;) Thanks anyway to all other solutions!!!user@server:~$ sudo su -...

View Article

Answer by josephmisiti for How do you create a read-only user in PostgreSQL?

If your database is in the public schema, it is easy (this assumes you have already created the readonlyuser)db=> GRANT SELECT ON ALL TABLES IN SCHEMA public to readonlyuser;GRANTdb=> GRANT...

View Article


Answer by Anvesh for How do you create a read-only user in PostgreSQL?

Reference taken from this blog:Script to Create Read-Only user:CREATE ROLE Read_Only_User WITH LOGIN PASSWORD 'Test1234';\connect YourDatabaseName;Assign permission to this read-only user:GRANT CONNECT...

View Article

Answer by Adrian Macneil for How do you create a read-only user in PostgreSQL?

By default new users will have permission to create tables. If you are planning to create a read-only user, this is probably not what you want.To create a true read-only user with PostgreSQL 9.0+, run...

View Article

Answer by Jakub Jirutka for How do you create a read-only user in PostgreSQL?

I’ve created a convenient script for that; pg_grant_read_to_db.sh. This script grants read-only privileges to a specified role on all tables, views and sequences in a database schema and sets them as...

View Article


Answer by Jay Taylor for How do you create a read-only user in PostgreSQL?

Here is the best way I've found to add read-only users (using PostgreSQL 9.0 or newer):$ sudo -upostgres psql postgrespostgres=# CREATE ROLE readonly WITH LOGIN ENCRYPTED PASSWORD...

View Article


Answer by kbulgrien for How do you create a read-only user in PostgreSQL?

Taken from a link posted in response to despesz' link.Postgres 9.x appears to have the capability to do what is requested. See the Grant On Database Objects paragraph...

View Article

Answer by bortzmeyer for How do you create a read-only user in PostgreSQL?

Do note that PostgreSQL 9.0 (today in beta testing) will have a simple way to do that:test=> GRANT SELECT ON ALL TABLES IN SCHEMA public TO joeuser;

View Article

Answer by araqnid for How do you create a read-only user in PostgreSQL?

Grant usage/select to a single tableIf you only grant CONNECT to a database, the user can connect but has no other privileges. You have to grant USAGE on namespaces (schemas) and SELECT on tables and...

View Article

Answer by Pablo Santa Cruz for How do you create a read-only user in PostgreSQL?

The not straightforward way of doing it would be granting select on each table of the database:postgres=# grant select on db_name.table_name to read_only_user;You could automate that by generating your...

View Article


How do you create a read-only user in PostgreSQL?

I'd like to create a user in PostgreSQL that can only do SELECTs from a particular database. In MySQL the command would be:GRANT SELECT ON mydb.* TO 'xxx'@'%' IDENTIFIED BY 'yyy';What is the equivalent...

View Article
Browsing latest articles
Browse All 14 View Live




Latest Images