Greetings-
I'm trying to write what should be a simple function that returns the
minimim of two integers. The complication is that when one of the two
integers is NULL, it should return the other; and when both are NULL, it
should return NULL. Here's what I've written:
CREATE FUNCTION min(int4,
Andrew Perrin writes:
> I'm trying to write what should be a simple function that returns the
> minimim of two integers. The complication is that when one of the two
> integers is NULL, it should return the other; and when both are NULL, it
> should return NULL.
Functions involving NULLs don't w
On Sun, Mar 11, 2001 at 10:38:10PM +0100, Peter Eisentraut wrote:
> Andrew Perrin writes:
>
> > I'm trying to write what should be a simple function that returns the
> > minimim of two integers. The complication is that when one of the two
> > integers is NULL, it should return the other; and wh
Thanks - I'll work on it that way. I know the general-case min() should
probably return NULL if any element is null, but I'm in need of what I
described for a specific case in which the result should be "the minimum
non-null entry", which of course is NULL if all entries are null.
---
I think that is a bug in plpgsql,
when passing a NULL into a plpgsql defined function, it treats
other arguments as NULL also, you can use raise notice in
your function to watch this buggy thing(see following).
Jie LIANG
St. Bernard Software
10350 Science Center Drive
Suite 100, San Diego, CA