Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id TAA21672 for ; Thu, 30 Mar 2000 19:12:15 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id TAA28674; Thu, 30 Mar 2000 19:11:49 -0500 (EST) To: Joseph Shraibman cc: Julie Hunt , "pgsql-sql@postgresql.org" Subject: Re: isnull In-reply-to: <38E3D461.E80EB898@selectacast.net> References: <004701bf9901$c2b322c0$9714a8c0@julies> <38E3D461.E80EB898@selectacast.net> Comments: In-reply-to Joseph Shraibman message dated "Thu, 30 Mar 2000 17:25:38 -0500" Date: Thu, 30 Mar 2000 19:11:49 -0500 Message-ID: <28671.954461509@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200003/9 Joseph Shraibman writes: > Ah, I think the documentation that came with 6.5.3 was wrong, because > http://www.postgresql.org/docs/postgres/functions.htm#AEN2257 has the > function nullif where ifnull was in my documentation. I don't get > errors now, but it just doesn't seem to do it's job. NULLIF doesn't do what you seem to expect: it is for *creating* nulls, not removing them. It produces a null if the two arguments are equal, else the first argument. COALESCE is probably the thing you are after: it produces the first nonnull value among its arguments, reading left to right. There isn't anything called IFNULL in the SQL92 spec, though there is an IS NULL test (note space). No, I didn't choose these names ;-) ... blame the SQL92 authors ... regards, tom lane