Search Postgresql Archives

Re: help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 26, 2005 at 01:41:12 -0700,
> All I need is integer columns evaluting in a 
> 
> nullif('1','') returns int = 1
> nullif('','') returns int = null 
> nullif('0','') returns int = 0
> 
> fashion upon inserting to an INTEGER column. Forget
> booleans. Forget text. Just integers. Is this
> possible? Nothing is impossible. Tell me it can be
> done!

Casting the parameters won't work since '' isn't a valid representation of
an integer. But it looks like casting the output to int works. (It seemed
to work in 8.0.3.)

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

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux