Skip site navigation (1) Skip section navigation (2)

Re: try/catch macros for Postgres backend

From: "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>
To: Alvaro Herrera Munoz <alvherre(at)dcc(dot)uchile(dot)cl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: try/catch macros for Postgres backend
Date: 2004-07-29 11:56:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Thu, Jul 29, 2004 at 12:10:12AM -0400, Alvaro Herrera Munoz wrote:
> (The "finally" block, AFAIU, is executed whether an exception was raised
> or not, so it serves as cleanup for try and catch blocks.  Somebody more
> knowledgeable in this OO matters may enlighten us better?)

...Or I could try.  Yes, the "finally" block is executed after executing
the "catch" block if an exception was caught, or when leaving the "try"
block if there wasn't.  That includes both normal completion and uncaught

This is useful for cleanup stuff, as you say--mostly because Java doesn't
have C++'s destructors to take the cleanup out of your hands.


In response to


pgsql-hackers by date

Next:From: LISTMANDate: 2004-07-29 12:38:19
Subject: Undefined symbol in library
Previous:From: Hans-Jürgen SchönigDate: 2004-07-29 11:55:15
Subject: Re: storage engine , mysql syntax CREATE TABLE t (i INT)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group