Re: let's make the list of reportable GUCs configurable (was Re: Add %r substitution for psql prompts to show recovery status)

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: Craig Ringer <craig(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>, Ian Barwick <ian(dot)barwick(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: let's make the list of reportable GUCs configurable (was Re: Add %r substitution for psql prompts to show recovery status)
Date: 2019-10-02 15:22:19
Message-ID: CA+TgmobY-OzPiM8kjWfL9j+VPrx-X_J8KNPMtoCALcfXVXBa5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 11, 2019 at 3:16 PM Dave Cramer <pg(at)fastcrypt(dot)com> wrote:
> On Thu, 11 Jul 2019 at 15:07, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> On Thu, Jul 11, 2019 at 2:29 PM Dave Cramer <pg(at)fastcrypt(dot)com> wrote:
>> > So if I understand this correctly if user bob has altered his search path and there is a security-definer function called owned by him then
>> > the search path will be changed for the duration of the function and reported for every iteration? The implications of this are "interesting" to say the least.
>>
>> I don't believe that it matters what search path has been set using
>> ALTER USER bob.
>
> Why wouldn't it ???

Because the search_path used to execute a security definer function
has nothing to do with the search_path that would be applied to a new
session created by bob.

Unless I am confused. But you can easily test this. Just make a
security-definer function that prints its search_path and experiment.
I think what's going to happen is that it'll inherit the search_path
from the surrounding session unless you use ALTER FUNCTION .. SET, and
that ALTER USER will make no difference. Sometimes I'm wrong, though.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Gierth 2019-10-02 15:24:05 Re: Possible bug: SQL function parameter in window frame definition
Previous Message Jehan-Guillaume de Rorthais 2019-10-02 15:08:07 Re: [HACKERS] Restricting maximum keep segments by repslots