Re: Disable script execution in server level when updating via grids - Mailing list pgsql-general

From Filip Sedlak
Subject Re: Disable script execution in server level when updating via grids
Date
Msg-id 6a1995fe-a2e5-4c47-8fea-520cd56e6925@sedlakovi.org
Whole thread Raw
In response to Disable script execution in server level when updating via grids  (arun chirappurath <arunsnmimt@gmail.com>)
List pgsql-general
I'd use different users or roles for that - one with more restricted 
rights. I'm not sure how to do it in your specific client.

In general, your user can be granted be granted read-only access and a 
more powerful role to which it can switch explicitly.

mydb=> CREATE TABLE x (id INT);
ERROR:  permission denied for schema public
LINE 1: CREATE TABLE x (id INT);
                      ^
mydb=> SET ROLE powerful;
SET
mydb=> CREATE TABLE x (id INT);
CREATE TABLE

In PostgreSQL up to 15, you have to set "NOINHERIT" to your user so you 
don't automatically get all the privileges on login. In 16, you can set 
INHERIT FALSE when granting the role.

--
Filip Sedlák



pgsql-general by date:

Previous
From: arun chirappurath
Date:
Subject: Disable script execution in server level when updating via grids
Next
From: Noel Jones
Date:
Subject: Re: Invalid Parent Index Issue Will Not Resolve Despite Multiple Attempts To Fix