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 05:44:25
Message-ID: 001601bfb4c2$a3f71f80$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]
>
> "Hiroshi Inoue" <Inoue(at)tpf(dot)co(dot)jp> writes:
> >> (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 ?
>
> Well, that's not a particularly good example, because it wouldn't
> be hard at all for us to avoid reducing "int2var = 32768::int4"
> to "int2var = 32768::int2" (oops).

Hmm,am I misunderstanding ?

As for conversion functions,shouldn't they return return-code
unless they could throw "catchable" exceptions ?
If the conversion 32768::int4 -> 32768::int2 returns an error
we would be able to find that "int2var = 32768::int4" is always
false.
If I recognize correctly,"catchable" exceptions means that
we could catch them if we want(otherwise they are dealt with
a default exception handler like current elog handler). So they
would be same as elog() except the special cases we are
interested in.

Where are problems when we handle conversion functions
with return code or "catchable" exceptions ?

Regards.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Mount 2000-05-03 06:36:19 RE: [HACKERS] Request for 7.0 JDBC status
Previous Message Thomas Lockhart 2000-05-03 05:07:56 Re: Why Not MySQL?