> -----Original Message-----
> From: pgsql-hackers-ow...@postgresql.org [mailto:pgsql-hackers-
> ow...@postgresql.org] On Behalf Of Robert Haas
> Sent: Monday, April 30, 2012 2:20 PM
> To: Peter Eisentraut
> Cc: pgsql-hackers
> Subject: Re: [HACKERS] precision and scale functions for numeric
> 
> 
> I think you could test for integer-ness by testing whether val % 0 = 0.
> 

Either I am missing something here or you are.  Since Modulus is a division
function anything "% 0" results in a division-by-zero ERROR - division has
to occur before a remainder can be obtained.

Maybe "val % 2 NOT IN (0,1)" ...

David J.





-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to