ifnull - Mailing list pgsql-interfaces

From Joseph Shraibman
Subject ifnull
Date
Msg-id 38C73BDF.B4C83976@selectacast.net
Whole thread Raw
List pgsql-interfaces
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.



pgsql-interfaces by date:

Previous
From: youxiangmail
Date:
Subject: A problem about psqlodbc.
Next
From: Peter Mount
Date:
Subject: RE: [INTERFACES] Type mappings