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

From Alvaro Herrera
Subject Re: How to handle error message in PG_CATCH
Date
Msg-id 20080304163654.GJ4755@alvh.no-ip.org
Whole thread Raw
In response to How to handle error message in PG_CATCH  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Responses Re: How to handle error message in PG_CATCH  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
List pgsql-hackers
Zdenek Kotala wrote:

> 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)

I don't see anything wrong with this code.  Perhaps the problem is
somewhere else?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: 8.3.0 Core with concurrent vacuum fulls
Next
From: Jan Urbański
Date:
Subject: Re: Google Summer of Code 2008