7.4.3 server panic - Mailing list pgsql-general

From Chris Ochs
Subject 7.4.3 server panic
Date
Msg-id 015101c47f1a$557b07a0$250a8b0a@chris
Whole thread Raw
Responses Re: 7.4.3 server panic
List pgsql-general
I have been able to crash the server a few times with the following function
when it is called on a user and schema that was recently deleted.  Following
is a log of what happened and also the function that was called.  This is
7.4.3 on Freebsd 5.2.1.  It doesn't always panic when it encounters a
deleted user/schema, it's kind of sporadic but happens often enough that
it's easy to duplicate.

Chris

----------------------------------------------------------------------------
------
CREATE OR REPLACE FUNCTION setuser(varchar) RETURNS integer AS
'
DECLARE
   in_username ALIAS FOR \$1;
BEGIN
   EXECUTE ''SET SESSION AUTHORIZATION '' || in_username;
   EXECUTE ''SET SEARCH_PATH TO '' || in_username || '',PUBLIC'';
   RETURN 1;
END '
LANGUAGE 'plpgsql';

----------------------------------------------------------------------------
-----
LOG:  statement:                                               select * from
setuser('support')
LOG:  statement: SET SESSION AUTHORIZATION support
CONTEXT:  PL/pgSQL function "setuser" line 4 at execute statement
LOG:  statement: SET SEARCH_PATH TO support,PUBLIC
CONTEXT:  PL/pgSQL function "setuser" line 5 at execute statement
ERROR:  schema "support" does not exist
CONTEXT:  PL/pgSQL function "setuser" line 5 at execute statement
STATEMENT:                                                select * from
setuser('support')
ERROR:  invalid user ID: 194
PANIC:  error during error recovery, giving up
LOG:  server process (PID 38302) was terminated by signal 6
LOG:  terminating any other active server processes
WARNING:  terminating connection because of crash of another server process
DETAIL:  The postmaster has commanded this server process to roll back the
current transaction and exit, because another server process exited
 abnormally and possibly corrupted shared memory.
HINT:  In a moment you should be able to reconnect to the database and
repeat your command.



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgres update with self join
Next
From: Franco Bruno Borghesi
Date:
Subject: Re: Postgres update with self join