| From: | Abdul Qoyyuum <aqoyyuum(at)cardaccess(dot)com(dot)au> |
|---|---|
| To: | Wolfgang Walther <walther(at)technowledgy(dot)de> |
| Cc: | pgsql-general(at)lists(dot)postgresql(dot)org |
| Subject: | Re: ALTER ROLE ... SET in current database only |
| Date: | 2021-02-16 06:32:49 |
| Message-ID: | CAA3DN=XEWesNO_S6QTBRcOe=WO29hsW=JB-W9TBiaU+7_BhsQQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Wouldnt you need to connect to the database first before you can ALTER ROLE
anything?
On Tue, Feb 16, 2021 at 1:25 AM Wolfgang Walther <walther(at)technowledgy(dot)de>
wrote:
> 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
>
>
>
--
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrus | 2021-02-16 06:48:35 | Turn jit off for slow subquery in Postgres 12 |
| Previous Message | Paolo Saudin | 2021-02-16 06:27:04 | Re: Replication sequence |