Reverting SET SESSION AUTHORIZATION command

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Reverting SET SESSION AUTHORIZATION command
Date: 2002-02-24 22:17:16
Message-ID: 12777.1014589036@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

It seems to me that it'd be a good idea to have a form of SET SESSION
AUTHORIZATION that restores the effective session ID to whatever user
name was originally authenticated.

In particular, this would eliminate the need for hacks like pg_dump's
need to know a superuser name for certain things (-S switch).
Instead, the convention could be to revert to the original username,
which is expected to be a superuser if you are using the options that
require it. (In this way, the superuser name can be determined when
loading the script, rather than having to hardwire it into the script
with consequent loss of cross-installation portability.)

The syntax that comes to mind offhand is
SET SESSION AUTHORIZATION DEFAULT;
but perhaps someone has a better idea.

Comments, objections?

BTW, I think it's well past time to make pg_dump use SET SESSION
AUTHORIZATION by default, or even always, instead of \connect commands.
Thoughts?

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2002-02-24 23:32:36 Re: Reverting SET SESSION AUTHORIZATION command
Previous Message Karl DeBisschop 2002-02-24 21:52:15 Re: Duration of beta period