Re: How to handle error message in PG_CATCH

From: Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How to handle error message in PG_CATCH
Date: 2008-03-04 19:30:43
Message-ID: 47CDA363.2080007@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane napsal(a):
> Zdenek Kotala <Zdenek(dot)Kotala(at)Sun(dot)COM> writes:
>> Alvaro Herrera napsal(a):
>>> Zdenek Kotala wrote:
>>>> 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?
>
>> There is whole test code. It is store procedure and there are nothing
>> special. The difference between this and autovacuum is that autovacuum
>> works without client side.
>
> The problem with this is it's violating the wire protocol. Once you've
> sent the client an ERROR message, it no longer expects to see any result
> from the SELECT that called the function.
>

Thanks for explanation. I added extra error message at the end of
function and it works now.

Thanks Zdenek

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-03-04 20:04:35 Re: "could not open relation 1663/16384/16584: No such file or directory" in a specific combination of transactions with temp tables
Previous Message Jan Urbański 2008-03-04 18:39:20 Re: Google Summer of Code 2008