Re: precision and scale functions for numeric

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'Robert Haas'" <robertmhaas(at)gmail(dot)com>, "'Peter Eisentraut'" <peter_e(at)gmx(dot)net>
Cc: "'pgsql-hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: precision and scale functions for numeric
Date: 2012-04-30 19:33:48
Message-ID: 014701cd2708$2aa01bd0$7fe05370$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org [mailto:pgsql-hackers-
> owner(at)postgresql(dot)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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-04-30 19:38:56 Re: Future In-Core Replication
Previous Message Albe Laurenz 2012-04-30 19:01:54 Re: Analyzing foreign tables & memory problems