Re: alter user/role CURRENT_USER - Mailing list pgsql-hackers

From Tom Lane
Subject Re: alter user/role CURRENT_USER
Date
Msg-id 9875.1414702785@sss.pgh.pa.us
Whole thread Raw
In response to Re: alter user/role CURRENT_USER  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Stephen Frost <sfrost@snowman.net> writes:
> The other idea which comes to mind is- could we try to actually resolve
> what the 'right' answer is here, instead of setting a special value and
> then having to detect and fix it later?

No, absolutely not.  Read the NOTES at the head of gram.y.  Or if you
need it spelled out: when we run the bison parser, we may not be inside a
transaction at all, and even if we are, we aren't necessarily going to
be seeing the same current user that will apply when the parsetree is
ultimately executed.  (Consider a query inside a plpgsql function, which
might be called under multiple userids over the course of a session.)

I think Alvaro's suggestion is a perfectly appropriate solution.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: infinite loop in _bt_getstackbuf
Next
From: Tom Lane
Date:
Subject: Re: alter user/role CURRENT_USER