Re: Document that PG_TRY block cannot have a return statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Serpent <serpent7776(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Document that PG_TRY block cannot have a return statement
Date: 2023-09-12 15:22:56
Message-ID: 2801961.1694532176@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Serpent <serpent7776(at)gmail(dot)com> writes:
> I'm talking about this part:

> PG_TRY();
> {
> ... code that might throw ereport(ERROR) ...
> }

Ah. Your phrasing needs work for clarity then. Also, "return"
is hardly the only way to break it; break, continue, or goto
leading out of the PG_TRY are other possibilities. Maybe more
like "The XXX code must exit normally (by control reaching
the end) if it does not throw ereport(ERROR)." Not quite sure
what to use for XXX.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-09-12 15:26:39 Re: Detoasting optionally to make Explain-Analyze less misleading
Previous Message stepan rutz 2023-09-12 15:16:00 Re: Detoasting optionally to make Explain-Analyze less misleading