Grokbase
Topics Posts Groups | in
x
[ help ]

" (c...@icp.pl)

Profile | Posts (1)

User Information

Display Name:"
Partial Email Address:c...@icp.pl
Posts:
1 total
1 in PostgreSQL - Bugs

1 Most Recent Post

1) " BUG #2946: server crashes when trying to catch exception in function
| +1 vote
The following bug has been logged online: Bug reference: 2946 Logged by: Email address:...
PostgreSQL - Bugs
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
The following bug has been logged online:

Bug reference:      2946
Logged by:          
Email address:      [email protected: c...@icp.pl]
PostgreSQL version: 8.2.0
Operating system:   Red Hat Enterprise Linux ES release 4
Description:        server crashes when trying to catch exception in
function
Details:

I have a function named test()

CREATE OR REPLACE FUNCTION test()
  RETURNS integer AS
$BODY$
DECLARE
     r INTEGER;
y INTEGER;
x INTEGER;
BEGIN
BEGIN
  select into r 1;
  y := r / 0;
  EXCEPTION 
  WHEN OTHERS THEN
  NULL;
END;
RETURN y;
END;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;


select * from test() causes a server crash


when I change

select into r 1;  to  r:=1;

all works fine.



there can be a

select into r id FROM some_table LIMIT 1;

or

WHEN division_by_zero THEN


and the server srashes too.


Chris.

spacer
Profile | Posts (1)
Home > People > "