ALTER ROLE ... SET in current database only

From: Wolfgang Walther <walther(at)technowledgy(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: ALTER ROLE ... SET in current database only
Date: 2021-02-15 17:25:38
Message-ID: 2b2fc152-63cb-1d4a-93c2-f57f28a98fce@technowledgy.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I'm trying to set a GUC for a role in the current database only - but
don't know the name of the database at the time of writing code. Could
be development, staging, ...

I would basically like to do something like this:

ALTER ROLE a IN CURRENT DATABASE SET b TO c;

Although that syntax doesn't exist (yet).

I think I could wrap it in a DO block and create the statement
dynamically. Alternatively, I could probably INSERT INTO / UPDATE
pg_db_role_setting manually?

Any other ideas how to achieve this easily? Does the proposed "IN
CURRENT DATABASE" syntax sound useful to anyone else?

Best,

Wolfgang

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2021-02-15 17:30:55 Re: How to post to this mailing list from a web based interface
Previous Message Thomas Guyot 2021-02-15 17:24:25 Re: How to post to this mailing list from a web based interface