Re: [HACKERS] BEGIN EXCEPTION END - small bug?

2004-08-13 Thread Tom Lane
Daniel Schuchardt <[EMAIL PROTECTED]> writes: > i tried a bit with errorhandling and found the following : > (i want to ignore the dublicate key exception) > ERROR: SPI_prepare failed for "ROLLBACK": SPI_ERROR_TRANSACTION You can't use ROLLBACK inside a plpgsql function. I agree that this error

[HACKERS] BEGIN EXCEPTION END - small bug?

2004-08-13 Thread Daniel Schuchardt
Hi list, i tried a bit with errorhandling and found the following : (i want to ignore the dublicate key exception) CREATE OR REPLACE FUNCTION test() RETURNS VARCHAR AS' BEGIN BEGIN INSERT INTO table a dublicate key (primary); EXCEPTION WHEN OTHERS THEN ROLLBACK; END; RETURN ''test''; END'LA