Re: numeric data type

From: Juan Pablo L(dot) <jpablolorenzetti(at)hotmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: numeric data type
Date: 2015-09-22 21:45:43
Message-ID: DUB130-W118E48265AC238B99E7E8DD9450@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Alvaro, thank you for your answer, PG_GETARG_NUMERIC does not exist .. cant find it in the source code and when running i get
undefined symbol: PG_GETARG_NUMERIC.

> Date: Tue, 22 Sep 2015 18:11:26 -0300
> From: alvherre(at)2ndquadrant(dot)com
> To: jpablolorenzetti(at)hotmail(dot)com
> CC: tgl(at)sss(dot)pgh(dot)pa(dot)us; pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] numeric data type
>
> Juan Pablo L. wrote:
> > thank you for your answer, the function is declared as:
> >
> > FUNCTION wtt_discount_account(IN in_phonenumber varchar(20),IN in_balanceid integer,IN in_chgval numeric(10,2))
> >
> > i chose numeric because is supposed to be better for numbers/money operations, supposed to be exact,
> > i would not want to loose precision because that is money, is there any other way which does not
> > involve loosing precision ? thankS!!
>
> What you need is to use PG_GETARG_NUMERIC, then, and use a Numeric *
> variable rather than float8.
>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2015-09-22 21:57:38 Re: numeric data type
Previous Message Alvaro Herrera 2015-09-22 21:11:26 Re: numeric data type