[HACKERS] proposal: catch warnings

2007-01-07 Thread Pavel Stehule
Hello, PostgreSQL allow only catch exception (elevel ERROR). SQL/PSM requires that warnings are catchable too. Simply solution's is adding one callback to error's processing of errors on level WARNING. typedef struct WarningHandlerCallback { bool(*callback) (void *arg,

Re: [HACKERS] proposal: catch warnings

2007-01-07 Thread Simon Riggs
On Sun, 2007-01-07 at 09:59 +0100, Pavel Stehule wrote: PostgreSQL allow only catch exception (elevel ERROR). SQL/PSM requires that warnings are catchable too. Simply solution's is adding one callback to error's processing of errors on level WARNING. Exceptions are run within their own

Re: [HACKERS] proposal: catch warnings

2007-01-07 Thread Pavel Stehule
On Sun, 2007-01-07 at 09:59 +0100, Pavel Stehule wrote: PostgreSQL allow only catch exception (elevel ERROR). SQL/PSM requires that warnings are catchable too. Simply solution's is adding one callback to error's processing of errors on level WARNING. Exceptions are run within their own

Re: [HACKERS] proposal: catch warnings

2007-01-07 Thread Simon Riggs
On Sun, 2007-01-07 at 11:20 +0100, Pavel Stehule wrote: On Sun, 2007-01-07 at 09:59 +0100, Pavel Stehule wrote: PostgreSQL allow only catch exception (elevel ERROR). SQL/PSM requires that warnings are catchable too. Simply solution's is adding one callback to error's processing of

Re: [HACKERS] proposal: catch warnings

2007-01-07 Thread Pavel Stehule
Does the PSM warning error handler run in the same transaction or a separate subtransaction? Can transaction execution continue afterwards? It's depend. Continue and exit warning handlers run in the same transaction, undo handler has separate subtransaction. It works well. For

Re: [HACKERS] proposal: catch warnings

2007-01-07 Thread Tom Lane
Pavel Stehule [EMAIL PROTECTED] writes: PostgreSQL allow only catch exception (elevel ERROR). SQL/PSM requires that warnings are catchable too. What in the world does it mean to catch a warning? If your intention is to process arbitrary user-defined code while inside the error subsystem, I

Re: [HACKERS] proposal: catch warnings

2007-01-07 Thread Pavel Stehule
What is problem? ANSI SQL has different model of handling exception than postgresql. It doesn't distinguishes between warnings and exception. Simply some sqlstate clases are reservated for warnings and other's for exception. But all sqlstate's (without '0') can be handled via any CONTINUE,

Re: [HACKERS] proposal: catch warnings

2007-01-07 Thread Tom Lane
Pavel Stehule [EMAIL PROTECTED] writes: What is problem? ANSI SQL has different model of handling exception than postgresql. It doesn't distinguishes between warnings and exception. Simply some sqlstate clases are reservated for warnings and other's for exception. But all sqlstate's

Re: [HACKERS] proposal: catch warnings

2007-01-07 Thread Pavel Stehule
Pavel Stehule [EMAIL PROTECTED] writes: What is problem? ANSI SQL has different model of handling exception than postgresql. It doesn't distinguishes between warnings and exception. Simply some sqlstate clases are reservated for warnings and other's for exception. But all sqlstate's