Home > Archive > PostgreSQL Discussion > August 2005 > Re: [SQL] question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SQL] question
Matt A.

2005-08-30, 3:24 am

The issue has been solved thanks to a custom
nullif_int() function. Which if anyone has the same
issue, it was solved with...


CREATE FUNCTION nullif_int(text) RETURNS integer AS
'SELECT nullif($1,'''')::int
;' LANGUAGE SQL;


SELECTS were not the issue; INSERT INTO a non-text
column was the issue.

Thanks anyway,
Matthew

--- "Thomas F. O'Connell" <tfo@sitening.com> wrote:

> Matt,
>
> In PostgreSQL 8.0.3, I see:
>
> postgres=# select nullif( '1', '' );
> nullif
> --------
> 1
> (1 row)
>
> postgres=# select nullif( '', '' ) is null;
> ?column?
> ----------
> t
> (1 row)
>
> What behavior are you expecting?
>
> --
> Thomas F. O'Connell
> Co-Founder, Information Architect
> Sitening, LLC
>
> Strategic Open Source: Open Your i™
>
> http://www.sitening.com/
> 110 30th Avenue North, Suite 6
> Nashville, TN 37203-6320
> 615-469-5150
> 615-469-5151 (fax)
>
> On Aug 24, 2005, at 12:05 AM, Matt A. wrote:
>
> level.
> for
> We
> doesn't
> other
> major
> our
> a
> accomplish
>
>





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


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com