From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | "Matt A(dot)" <survivedsushi(at)yahoo(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: help |
Date: | 2005-08-25 21:52:44 |
Message-ID: | 20050825215244.GD17679@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Very odd, what are you trying?
kleptog=# select nullif('','') is null;
?column?
----------
t
(1 row)
kleptog=# select nullif('1','') is null;
?column?
----------
f
(1 row)
Works for me.
Have a nice day,
On Thu, Aug 25, 2005 at 01:44:52PM -0700, Matt A. wrote:
> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.
From | Date | Subject | |
---|---|---|---|
Next Message | CSN | 2005-08-25 22:03:30 | POSS. FEATURE REQ: "Dynamic" Views |
Previous Message | Chris Browne | 2005-08-25 21:48:46 | Re: Postgresql replication |