RE: When malloc returns zero ...

From: "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "Jan Wieck" <wieck(at)debis(dot)com>, "PostgreSQL Development" <pgsql-hackers(at)postgresql(dot)org>, "Mark Hollomon" <mhh(at)nortelnetworks(dot)com>
Subject: RE: When malloc returns zero ...
Date: 2000-05-03 00:20:04
Message-ID: 000c01bfb495$544fb5a0$2801007e@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
>
> >> I agree with Peter at this point.
> >> For example,even basic functions call elog() easily but we can't
> >> catch the error and we(at least I) couldn't call basic functions
> >> easily. In fact I suffered very much to avoid elog() call in order
> >> to enable dropping tables whose base relation files has already
> >> been removed
>
> > The current model is also problematical in the case of procedural
> > languages as well. Many times, when there is an error, both
> > the backend and the PL handler needs to do cleanup. But it
> > is very hard for the PL handler to 'capture' the exception in
> > order to do the cleanup.
>
> It would be fairly easy to extend the existing setjmp/longjmp support
> to allow multiple layers of code to catch an elog(ERROR) on its way
> out to the outer loop. That might be a better answer for things like
> PL handlers than the current approach, which is basically "any cleanup
> you need, you'd better be prepared to do as part of transaction abort
> processing".
>
> (BTW, I actually think that the current approach is more robust than
> exception catchers for modules that are part of the standard system;
> it forces on you the discipline of making sure that all recoverable
> resources are tracked in data structures less transient than some
> routine's local variables.

Hmm,for the query SELECT .. FROM .. WHERE int2key = 1;
we coudn't try to convert 1 -> 1::int2 because the conversion may
cause elog(ERROR). Isn't it too restrictive ?

Comments ?

Hiroshi Inoue
Inoue(at)tpf(dot)co(dot)jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message frank 2000-05-03 01:10:09 7.0RC2 compile error !
Previous Message Tom Cook 2000-05-02 23:24:59 Re: postgresql7.0 jdbc driver