Presumably, the "is_superuser" parameter was intended to make the updating
of psql's prompt more accurate when SET SESSION AUTHORIZATION is used.
However, if the prompt is customized to include the user name (%n), then
the prompt changes to reflect the real superuser status, but does not
change the user name.  I guess we need to pass "session_user" as well.

-- 
Peter Eisentraut   peter_e@gmx.net

Mon, 28 Jul 2003 09:50:29 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
"is_superuser" parameter creates inconsistencies
Peter Eisentraut <peter_e@gmx.net> writes:
> Presumably, the "is_superuser" parameter was intended to make the updating
> of psql's prompt more accurate when SET SESSION AUTHORIZATION is used.
> However, if the prompt is customized to include the user name (%n), then
> the prompt changes to reflect the real superuser status, but does not
> change the user name.  I guess we need to pass "session_user" as well.

Seems reasonable.  IIRC the only addition needed to the server code is
to set a flag in the variable's GUC entry.

			regards, tom lane

Mon, 28 Jul 2003 10:28:25 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: "is_superuser" parameter creates inconsistencies 

Has this been addressed?

---------------------------------------------------------------------------

Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Presumably, the "is_superuser" parameter was intended to make the updating
> > of psql's prompt more accurate when SET SESSION AUTHORIZATION is used.
> > However, if the prompt is customized to include the user name (%n), then
> > the prompt changes to reflect the real superuser status, but does not
> > change the user name.  I guess we need to pass "session_user" as well.
> 
> Seems reasonable.  IIRC the only addition needed to the server code is
> to set a flag in the variable's GUC entry.
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Sat, 16 Aug 2003 23:22:41 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: "is_superuser" parameter creates inconsistencies
Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Presumably, the "is_superuser" parameter was intended to make the updating
> > of psql's prompt more accurate when SET SESSION AUTHORIZATION is used.
> > However, if the prompt is customized to include the user name (%n), then
> > the prompt changes to reflect the real superuser status, but does not
> > change the user name.  I guess we need to pass "session_user" as well.
> 
> Seems reasonable.  IIRC the only addition needed to the server code is
> to set a flag in the variable's GUC entry.

Is this a TODO item or something we want to address for 7.4?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Sun, 31 Aug 2003 00:05:59 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: "is_superuser" parameter creates inconsistencies
Bruce Momjian writes:

> Tom Lane wrote:
> > Peter Eisentraut <peter_e@gmx.net> writes:
> > > Presumably, the "is_superuser" parameter was intended to make the updating
> > > of psql's prompt more accurate when SET SESSION AUTHORIZATION is used.
> > > However, if the prompt is customized to include the user name (%n), then
> > > the prompt changes to reflect the real superuser status, but does not
> > > change the user name.  I guess we need to pass "session_user" as well.
> >
> > Seems reasonable.  IIRC the only addition needed to the server code is
> > to set a flag in the variable's GUC entry.
>
> Is this a TODO item or something we want to address for 7.4?

I'd like to address it for 7.4, but it looks a bit more difficult than it
seemed at first, because session_user isn't in GUC at all, so there is no
infrastructure to pass it to the client.

-- 
Peter Eisentraut   peter_e@gmx.net


Sun, 31 Aug 2003 21:03:58 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: "is_superuser" parameter creates inconsistencies
Peter Eisentraut <peter_e@gmx.net> writes:
> Bruce Momjian writes:
>> Is this a TODO item or something we want to address for 7.4?

> I'd like to address it for 7.4, but it looks a bit more difficult than it
> seemed at first, because session_user isn't in GUC at all, so there is no
> infrastructure to pass it to the client.

We'd have to add it, presumably as a read-only variable.  I didn't think
that was particularly difficult though ...

			regards, tom lane

Sun, 31 Aug 2003 19:10:18 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: "is_superuser" parameter creates inconsistencies 

This item has been added to the 7.4 open items list:

	ftp://momjian.postgresql.org/pub/postgresql/open_items


	Allow SET SESSION AUTHORIZATION to update the psql %n user display

---------------------------------------------------------------------------

Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Bruce Momjian writes:
> >> Is this a TODO item or something we want to address for 7.4?
> 
> > I'd like to address it for 7.4, but it looks a bit more difficult than it
> > seemed at first, because session_user isn't in GUC at all, so there is no
> > infrastructure to pass it to the client.
> 
> We'd have to add it, presumably as a read-only variable.  I didn't think
> that was particularly difficult though ...
> 
> 			regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Sat, 27 Sep 2003 16:37:52 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: "is_superuser" parameter creates inconsistencies
Bruce Momjian writes:

> 	Allow SET SESSION AUTHORIZATION to update the psql %n user display

This already works.

-- 
Peter Eisentraut   peter_e@gmx.net


Sat, 4 Oct 2003 02:51:39 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: "is_superuser" parameter creates inconsistencies

OK, item remvoed.

---------------------------------------------------------------------------

Peter Eisentraut wrote:
> Bruce Momjian writes:
> 
> > 	Allow SET SESSION AUTHORIZATION to update the psql %n user display
> 
> This already works.
> 
> -- 
> Peter Eisentraut   peter_e@gmx.net
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Fri, 3 Oct 2003 22:35:15 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: "is_superuser" parameter creates inconsistencies