Re: C exception code - Mailing list pgsql-hackers

From Giles Lean
Subject Re: C exception code
Date
Msg-id 1278.962055413@nemeton.com.au
Whole thread Raw
In response to C exception code  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: C exception code
List pgsql-hackers
> Are we interested in adding Try/Catch exception code to PostgreSQL. 
> This looks interesting:
> 
>     http://www.cs.berkeley.edu/~amc/cexcept/

IMHO using the C pre-processor to make C look like some other language:

- makes the code harder to read as readers have to learn the dialect first

- makes the code harder to debug, since debugging tools don't know the dialect but only the C it is translated into

This exception implementation has the obvious(?) problem of using
setjump()/longjmp() where sigsetjmp()/siglongjmp() would probably be
necessary for postgresql.

There are places too where this implementation would just plain not
work and so couldn't be used: setjmp(), longjmp(), sigsetjump(), and
siglongjmp() are not async safe signal functions and so can't be
called in signal handlers, for a start.

Regards,

Giles





pgsql-hackers by date:

Previous
From: Giles Lean
Date:
Subject: Re: Proposal: More flexible backup/restore via pg_dump
Next
From: Bruce Momjian
Date:
Subject: Re: C exception code