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

pgsql: Prevent show_session_authorization from crashing whensession_au

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Prevent show_session_authorization from crashing whensession_au
Date: 2010-09-23 20:54:52
Message-ID: E1Oysoe-0006hh-N7@gemulon.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Prevent show_session_authorization from crashing when session_authorization
hasn't been set.

The only known case where this can happen is when show_session_authorization
is invoked in an autovacuum process, which is possible if an index function
calls it, as for example in bug #5669 from Andrew Geery.  We could perhaps
try to return a sensible value, such as the name of the cluster-owning
superuser; but that seems like much more trouble than the case is worth,
and in any case it could create new possible failure modes.  Simply
returning an empty string seems like the most appropriate fix.

Back-patch to all supported versions, even those before autovacuum, just
in case there's another way to provoke this crash.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=660fbec560335292db9e05e4ad5d46437bb806bc

Modified Files
--------------
src/backend/commands/variable.c |    4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

pgsql-committers by date

Next:From: Tom LaneDate: 2010-09-23 20:54:53
Subject: pgsql: Prevent show_session_authorization from crashing whensession_au
Previous:From: User MkzDate: 2010-09-23 20:26:56
Subject: pgbouncer - pgbouncer: Use AC_PROG_INSTALL & ./install-sh This should

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