Re: [SQL] PL/PgSQL and NULL

2001-03-15 Thread Jan Wieck
Jie Liang wrote: > > 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). You're blaming the wrong code for it. It's an insuffi

Re: [SQL] PL/PgSQL and NULL

2001-03-11 Thread Jie Liang
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

Re: [SQL] PL/PgSQL and NULL

2001-03-11 Thread Andrew Perrin
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. ---

Re: [SQL] PL/PgSQL and NULL

2001-03-11 Thread Ross J. Reedstrom
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

Re: [SQL] PL/PgSQL and NULL

2001-03-11 Thread Peter Eisentraut
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

[SQL] PL/PgSQL and NULL

2001-03-11 Thread Andrew Perrin
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,