From: Wolfgang Walther <walther@technowledgy.de>
To: pgsql-general@lists.postgresql.org
Subject: ALTER ROLE ... SET in current database only
Date: Mon, 15 Feb 2021 18:25:38 +0100
Message-ID: <2b2fc152-63cb-1d4a-93c2-f57f28a98fce@technowledgy.de> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: walther@technowledgy.de
Subject: Re: ALTER ROLE ... SET in current database only
In-Reply-To: <2b2fc152-63cb-1d4a-93c2-f57f28a98fce@technowledgy.de>
References: <2b2fc152-63cb-1d4a-93c2-f57f28a98fce@technowledgy.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox