help - Mailing list pgsql-general

From Matt A.
Subject help
Date
Msg-id 20050825204453.89783.qmail@web35202.mail.mud.yahoo.com
Whole thread Raw
Responses Re: help  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
We used nullif('$value','') on inserts in mssql.  We
moved to postgres but the nullif() function doesn't
match empty strings to each other to return null.

MS SQL2000 nullif('1','') would insert 1 as integer
even though wrapped in '' (aka string). Also
nullif('','') would evaluate NULL (both equal returns
NULL) and insert the "not a value" accordingly, not
return text 'NULL' instead of return NULL if '' == ''.
Postgresql will through an error since the defined
return type is text.

I would like to alter this function all together. How
could I find it to manipulate it?

We cannot always enter a value for a integer, text,
boolean, etc column.

Is there any other way to accomplish this in any
language? C? Python? PL/x? If so can you suggest where
we could learn how to do this or provide an example?

Please help.

Domo
Matthew



____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs


pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Help with a subselect inside a view
Next
From: William Yu
Date:
Subject: Re: Postgresql replication