Re: ALTER SESSION

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Cc: tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com, robertmhaas(at)gmail(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, bruce(at)momjian(dot)us, GavinFlower(at)archidevsys(dot)co(dot)nz, ideriha(dot)takeshi(at)jp(dot)fujitsu(dot)com, alvherre(at)alvh(dot)no-ip(dot)org, andres(at)anarazel(dot)de, michael(dot)paquier(at)gmail(dot)com, david(at)pgmasters(dot)net, craig(at)2ndquadrant(dot)com
Subject: Re: ALTER SESSION
Date: 2019-01-30 01:28:28
Message-ID: 20190130.102828.173668230.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 29 Jan 2019 20:32:54 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <20190129(dot)203254(dot)115361483(dot)horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
> Hello.
>
> https://www.postgresql.org/message-id/20190128.133143.115303042.horiguchi.kyotaro@lab.ntt.co.jp
>
> > C. Provide session-specific GUC variable (that overides the global one)
> > - Add new configuration file "postgresql.conf.<PID>" and
> > pg_reload_conf() let the session with the PID loads it as if
> > it is the last included file. All such files are removed at
> > startup or at the end of the coressponding session.
> >
> > - Add a new syntax like this:
> > ALTER SESSION WITH (pid=xxxx)
> > SET configuration_parameter {TO | =} {value | 'value' | DEFAULT}
> > RESET configuration_parameter
> > RESET ALL
> >
> > - Target variables are marked with GUC_REMOTE.
> >
> > I'll consider the last choice and will come up with a patch.
>
> This is that, with a small change in design.
>
> ALTER SESSION WITH (pid <pid>) SET param {TO|=} value [ IMMEDIATE ]
> ALTER SESSION WITH (pid <pid>) RESET param [ IMMEDIATE ]
> ALTER SESSION WITH (pid <pid>) RESET ALL
>
> The first form create an entry in
> $PGDATA/pg_session_conf/postgresql.<beid>.conf.
> The second form removes the entry.
> The third form removes the file itself.
>
> IMMEDIATE specifies that the change is applied immediately by
> sending SIGHUP to the process. pg_reload_conf() works as well.
>
> The session configuration is removed at session-end and the
> directory is cleaned up at startup.
>
> It can change varaibles of PGC_USERSET by non-superuser or
> PGC_SUSET by superuser. The local session user should have the
> same privileges with pg_signal_backend() on the target session.
>
> This patch contains documentation but doesn't contain test yet.
>
> I would appreciate any comments or suggestions on this.

Minor updates and rebased.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
v2-0001-ALTER-SESSION.patch text/x-patch 31.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2019-01-30 01:39:53 Re: ALTER SESSION
Previous Message Kyotaro HORIGUCHI 2019-01-30 01:26:34 Re: [HACKERS] WAL logging problem in 9.4.3?