backend process crash - PL/pgSQL functions - parsing problem?
От | damonhart@yahoo.com (Damon Hart) |
---|---|
Тема | backend process crash - PL/pgSQL functions - parsing problem? |
Дата | |
Msg-id | 5f569cfd.0301311633.382d6bc8@posting.google.com обсуждение исходный текст |
Ответы |
Re: backend process crash - PL/pgSQL functions - parsing problem?
|
Список | pgsql-general |
My apologies for the long posting to the general group. Please follow up via email if appropriate and I will post a summary. I have a related set of PL/pgSQL functions which, when executed, crash the backend associated with my connection, dropping me out of the front end (psql) with the message: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed. The postgresql log indicates that the backend is crashing with SIGSEGV. This is postgreSQL 7.2 running on Linux (Intel, roughly Mandrake 8.2) I adjusted whatever came to mind in the functions themselves until, just by luck, I found that if I shortened the length of the function names, the crash disappeared. Below follows a simplified rendering of the functions which can reproduce the crash behavior. Strangely, either shortening the function names or deleting the filler comments eliminates the crashing. Since such changes seem completely textual, I can only speculate that there is a problem in the parsing. However, it's interesting to note that the crash only happens when the functions b_345...() and c_345...() are called from the body of a_345(). They can be successfully called independently from psql - in fact, following such a call to b_345...(), subsequent calls to a_345...() succeed (for the remainder of the connection.) I have working versions of my functions, but I'd like to understand the whys and wherefores of a problem that I'm likely to encounter again. thanks, Damon Hart /* begin pg_error.sql */ CREATE OR REPLACE FUNCTION a_34567890(INTEGER) RETURNS INTEGER AS ' BEGIN EXECUTE ''SELECT b_3456789012345678901234567890('' || $1 || '');''; EXECUTE ''SELECT c_3456789012345678901234567890('' || $1 || '');''; RETURN $1; END; ' LANGUAGE 'plpgsql'; CREATE OR REPLACE FUNCTION b_3456789012345678901234567890(INTEGER) RETURNS INTEGER AS ' BEGIN CREATE OR REPLACE FUNCTION c_3456789012345678901234567890(INTEGER) RETURNS INTEGER AS '' DECLARE BEGIN -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments RETURN $1; END; '' LANGUAGE ''plpgsql''; -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments -- just a bunch of comments RETURN $1; END ' LANGUAGE 'plpgsql'; /* end pg_error.sql */
В списке pgsql-general по дате отправления:
Следующее
От: Erwin MollerДата:
Сообщение: Postgresql7.3: after dropping a column a .............pg.dropped............ column exists