Re: How to handle error message in PG_CATCH

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How to handle error message in PG_CATCH
Date: 2008-03-04 16:36:54
Message-ID: 20080304163654.GJ4755@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Urbański 2008-03-04 16:47:49 Re: Google Summer of Code 2008
Previous Message Alvaro Herrera 2008-03-04 16:35:44 Re: 8.3.0 Core with concurrent vacuum fulls