Received: from p1.selectacast.net (IDENT:root@p1.selectacast.net [206.41.1.251] (may be forged)) by hub.org (8.9.3/8.9.3) with ESMTP id AAA92589 for ; Thu, 9 Mar 2000 00:51:38 -0500 (EST) (envelope-from jks@p1.selectacast.net) Received: from selectacast.net (IDENT:jks@d1 [209.219.91.66]) by p1.selectacast.net (8.9.3/8.9.3) with ESMTP id AAA05311 for ; Thu, 9 Mar 2000 00:51:30 -0500 Sender: jks@p1.selectacast.net Message-ID: <38C73BDF.B4C83976@selectacast.net> Date: Thu, 09 Mar 2000 00:51:28 -0500 From: Joseph Shraibman Organization: Xtenit X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.13 i686) X-Accept-Language: en MIME-Version: 1.0 To: "pgsql-interfaces@postgreSQL.org" Subject: ifnull Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Could someone tell me how to use ifnull? Whenever I try it postgres tells me: playpen=> insert into tabled (userkey, value) values (2, ifnull(null, 'c')); ERROR: No such function 'ifnull' with the specified attributes What I need it for is when I do an insert into my table like this: playpen=> insert into tabled select max(userkey) + 1, 'texthere'; ERROR: ExecAppend: Fail to add null value in not null attribute userkey ... I get a problem when I'm inserting the first data into the table because max returns null.