How to handle error message in PG_CATCH - Mailing list pgsql-hackers

From Zdenek Kotala
Subject How to handle error message in PG_CATCH
Date
Msg-id 47CD1253.3090508@sun.com
Whole thread Raw
Responses Re: How to handle error message in PG_CATCH  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
I'm working on implementing pg_check functions. Because I want to test 
whole table I need catch a error and handle it myself. I use following 
construct:



PG_TRY();
{...ereport(ERROR, (errmsg("Error test")));...
}
PG_CATCH();
{errcontext("Context error");        EmitErrorReport();        FlushErrorState();
}
PG_END_TRY();

At the end I got following message:

ERROR:  Error test
CONTEXT:  Context error
server sent data ("D" message) without prior row description ("T" message)

and also nothing appears in a log file. Similar concept is used in
autovacuum.c.

Any idea what is wrong?
    Thanks for help Zdenek


pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: Replacing the corrupt "global" folder with older one
Next
From: "Heikki Linnakangas"
Date:
Subject: Re: "could not open relation 1663/16384/16584: No such file or directory" in a specific combination of transactions with temp tables