Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group