Re: Syntax error in plpgsql crashes backend - Mailing list pgsql-sql

From Joseph Barillari
Subject Re: Syntax error in plpgsql crashes backend
Date
Msg-id m3lmazhj2g.fsf@washer.barillari.org
Whole thread Raw
In response to Syntax error in plpgsql crashes backend  (Joseph Barillari <jbarilla@princeton.edu>)
Responses Re: Syntax error in plpgsql crashes backend
Re: Syntax error in plpgsql crashes backend
List pgsql-sql
More fun with the backend: I've found that I can incite a crash by
reloading a long, but syntactically correct function twice. Is this a
problem with my installation? --Joe

cal=> \i test
CREATE
cal=> select foo();foo
-----  1
(1 row)

cal=> \i test
CREATE
cal=> select foo();
pqReadData() -- backend closed the channel unexpectedly.This probably means the backend terminated abnormallybefore or
whileprocessing the request. 
The connection to the server was lost. Attempting reset: Failed.
!>


On the console:

DEBUG:  server process (pid 18109) was terminated by signal 11
DEBUG:  terminating any other active server processes
DEBUG:  all server processes terminated; reinitializing shared memory and semaphores
DEBUG:  database system was interrupted at 2002-05-04 14:18:31 EDT
DEBUG:  checkpoint record is at 0/424D570
DEBUG:  redo record is at 0/424D570; undo record is at 0/0; shutdown TRUE
DEBUG:  next transaction id: 41770; next oid: 164012
DEBUG:  database system was not properly shut down; automatic recovery in progress
FATAL 1:  The database system is starting up
DEBUG:  redo starts at 0/424D5B0
DEBUG:  ReadRecord: record with zero length at 0/4253914
DEBUG:  redo done at 0/42538F0
DEBUG:  database system is ready


Function body:

CREATE OR REPLACE FUNCTION foo()   RETURNS INTEGER   AS '
DECLAREquerystr TEXT;
BEGIN
querystr := ''            -- blah blah blah blah blah blah blah blah blah blah blah             -- blah blah blah blah
blahblah blah blah blah blah blah             -- blah blah blah blah blah blah blah blah blah blah blah             --
blahblah blah blah blah blah blah blah blah blah blah             -- blah blah blah blah blah blah blah blah blah blah
blah            -- blah blah blah blah blah blah blah blah blah blah blah             -- blah blah blah blah blah blah
blahblah blah blah blah             -- blah blah blah blah blah blah blah blah blah blah blah             -- blah blah
blahblah blah blah blah blah blah blah blah             -- blah blah blah blah blah blah blah blah blah blah blah
     -- blah blah blah blah blah blah blah blah blah blah blah             -- blah blah blah blah blah blah blah blah
blahblah blah             -- blah blah blah blah blah blah blah blah blah blah blah             -- blah blah blah blah
blahblah blah blah blah blah blah             -- blah blah blah blah blah blah blah blah blah blah blah             --
blahblah blah blah blah blah blah blah blah blah blah             -- blah blah blah blah blah blah blah blah blah blah
blah            -- blah blah blah blah blah blah blah blah blah blah blah             -- blah blah blah blah blah blah
blahblah blah blah blah             -- blah blah blah blah blah blah blah blah blah blah blah             -- blah blah
blahblah blah blah blah blah blah blah blah             -- blah blah blah blah blah blah blah blah blah blah blah
     -- blah blah blah blah blah blah blah blah blah blah blah             -- blah blah blah blah blah blah blah blah
blahblah blah             -- blah blah blah blah blah blah blah blah blah blah blah             -- blah blah blah blah
blahblah blah blah blah blah blah  


'';
return 1;
end;
'
language 'plpgsql';

pgsql-sql by date:

Previous
From: Ian Barwick
Date:
Subject: Re: difficult query
Next
From: dman
Date:
Subject: Re: Syntax error in plpgsql crashes backend