Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 182CD9FB6A8 for ; Wed, 1 Nov 2006 14:10:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 34460-04 for ; Wed, 1 Nov 2006 14:09:11 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.168]) by postgresql.org (Postfix) with ESMTP id 49C539FB835 for ; Wed, 1 Nov 2006 08:06:19 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id z36so1558493uge for ; Wed, 01 Nov 2006 04:06:17 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=tYz7u0dk9TvriKLzstAHCesjytLD/IcRBhxir+eWyHZCWxF7IPr8xXGWeRhLXVrkQovmtj37zev1h+KI6AQmFDss6U7whhjA5VnnOBZ4ypdkpSqQEmLa/xFt7x5B9XMvpi0ugSFPP2kihNy2amzrZMoH+RK/aNmqdM6E5SnkU3o= Received: by 10.67.119.13 with SMTP id w13mr8012043ugm; Wed, 01 Nov 2006 04:06:17 -0800 (PST) Received: by 10.67.118.11 with HTTP; Wed, 1 Nov 2006 04:06:17 -0800 (PST) Message-ID: <55c095e90611010406x258b3d23h2268709e5812b3a7@mail.gmail.com> Date: Wed, 1 Nov 2006 10:06:17 -0200 From: "Ezequias Rodrigues da Rocha" To: "Andrew Sullivan" Subject: Re: Round Numeric Type Cc: pgsql-sql@postgresql.org In-Reply-To: <20061031211824.GC20809@phlogiston.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_24634_1640661.1162382777228" References: <55c095e90610311135l101f6a91s433e6d7e5b90cb7c@mail.gmail.com> <20061031211824.GC20809@phlogiston.dyndns.org> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/4 X-Sequence-Number: 26656 ------=_Part_24634_1640661.1162382777228 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Numeric(9,2) 2006/10/31, Andrew Sullivan : > > On Tue, Oct 31, 2006 at 05:35:17PM -0200, Ezequias Rodrigues da Rocha > wrote: > > Hi list, > > > > I did a trigger to update a points on a table but in some cases the > > PostgreSQL does a round of my Numeric like. > > > > If >=3D 0.5 so postgresql puts 1 > > If < 0.5 so postgresql puts 0 > > > > Did anybody knows if it is possible to control this matter ? > > Sounds like your datatype doesn't match your input, and that you've > got a type that rounds. What's the datatype you're putting into? > > A > > -- > Andrew Sullivan | ajs@crankycanuck.ca > Users never remark, "Wow, this software may be buggy and hard > to use, but at least there is a lot of code underneath." > --Damien Katz > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > --=20 =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- A pior das democracias ainda =E9 melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ------=_Part_24634_1640661.1162382777228 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Numeric(9,2)

2006/10/31, Andrew Sul= livan <ajs@crankycanuck.ca>= ;:
On Tue, Oct 31, 2006 at 05:35:17PM -0200, Ezequias Rodrigues da Rocha wrote= :
> Hi list,
>
> I did a trigger to update a points on a = table but in some cases the
> PostgreSQL does a round of my Numeric l= ike.
>
> If >=3D 0.5 so postgresql puts 1
> If < 0.5 so= postgresql puts 0
>
> Did anybody knows if it is possible to c= ontrol this matter ?

Sounds like your datatype doesn't match your in= put, and that you've
got a type that rounds.  What's the datatype you're putting i= nto?

A

--
Andrew Sullivan  | ajs@crankycanuck.ca
Users never remark, "Wo= w, this software may be buggy and hard
to use, but at least there is a lot of code underneath."
 =             &nb= sp;  --Damien Katz

---------------------------(end of broa= dcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster<= br>



--
=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-
   &nbs= p;            &= nbsp;           &nbs= p;     Atenciosamente (Sincerely)
  &= nbsp;           &nbs= p;         Ezequias Rodrigues = da Rocha
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -
A pior das democracias ainda =E9 melhor do que a melhor das ditaduras<= br>The worst of democracies is still better than the better of dictatorship= s
http://ezequiasrocha.bl= ogspot.com/ ------=_Part_24634_1640661.1162382777228--