Re: [GENERAL] numeric data type

2015-09-23 Thread Juan Pablo L .
Alvaro, thank you, that worked. > Date: Tue, 22 Sep 2015 18:57:38 -0300 > From: alvhe...@2ndquadrant.com > To: jpablolorenze...@hotmail.com > CC: t...@sss.pgh.pa.us; pgsql-general@postgresql.org > Subject: Re: [GENERAL] numeric data type > > Juan Pablo L. wrote: > &g

Re: [GENERAL] numeric data type

2015-09-22 Thread Alvaro Herrera
Juan Pablo L. wrote: > 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. #include "utils/numeric.h" -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL

Re: [GENERAL] numeric data type

2015-09-22 Thread Juan Pablo L .
m > CC: t...@sss.pgh.pa.us; pgsql-general@postgresql.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 > > i

Re: [GENERAL] numeric data type

2015-09-22 Thread Alvaro Herrera
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 b

Re: [GENERAL] numeric data type

2015-09-22 Thread Juan Pablo L .
precision because that is money, is there any other way which does not involve loosing precision ? thankS!! > From: t...@sss.pgh.pa.us > To: jpablolorenze...@hotmail.com > CC: pgsql-general@postgresql.org > Subject: Re: [GENERAL] numeric data type > Date: Tue, 22 Sep 2015

Re: [GENERAL] numeric data type

2015-09-22 Thread Tom Lane
"Juan Pablo L." writes: > Hi, i m writing a C module (extension), the procedure has a parameter that > is of type numeric, > inside the function i can not read the parameter or so it seems, this what is > do: > float8 db_balance,in_chgval; > in_chgval = PG_GETARG_FLOAT8(2); > elog(INFO,"in_

[GENERAL] numeric data type

2015-09-22 Thread Juan Pablo L .
Hi, i m writing a C module (extension), the procedure has a parameter that is of type numeric, inside the function i can not read the parameter or so it seems, this what is do: float8 db_balance,in_chgval; in_chgval = PG_GETARG_FLOAT8(2); elog(INFO,"in_chgval = %0.2f",in_chgval); The above

Re: [GENERAL] numeric data type?

2006-01-23 Thread Martijn van Oosterhout
On Mon, Jan 23, 2006 at 09:48:52AM -0500, John D. Burger wrote: > I have a (only vaguely) related question about NUMERICs. I'm using > someone else's schema to copy data from their DB into mine. They use > NUMERIC quite a bit, with scale 0, where I would use one of the integer > types. My que

Re: [GENERAL] numeric data type?

2006-01-23 Thread John D. Burger
I have a (only vaguely) related question about NUMERICs. I'm using someone else's schema to copy data from their DB into mine. They use NUMERIC quite a bit, with scale 0, where I would use one of the integer types. My question is whether joining and matching on NUMERIC is likely to be slower

Re: [GENERAL] numeric data type?

2006-01-23 Thread Zlatko Matić
OK. Thanks for clarification. - Original Message - From: "Doug McNaught" <[EMAIL PROTECTED]> To: "Zlatko Matić" <[EMAIL PROTECTED]> Cc: ; "Tony Caduto" <[EMAIL PROTECTED]> Sent: Sunday, January 22, 2006 2:39 PM Subject: Re: [GE

Re: [GENERAL] numeric data type?

2006-01-22 Thread Doug McNaught
Zlatko Matić <[EMAIL PROTECTED]> writes: > So, it seems that numeric without parameters (precision, scale) behave > similar to float, but is much exact. Am I right or I missunderstood? Right. It's also considerably slower, since floating point calculations can use the hardware. Unless you're do

Re: [GENERAL] numeric data type?

2006-01-22 Thread Zlatko Matić
similar to float, but is much exact. Am I right or I missunderstood? Thanks, Zlatko - Original Message - From: "Tony Caduto" <[EMAIL PROTECTED]> To: "Zlatko Matić" <[EMAIL PROTECTED]> Sent: Saturday, January 21, 2006 5:15 PM Subject: Re: [GENERAL] numeri

[GENERAL] numeric data type?

2006-01-21 Thread Zlatko Matić
Is "numeric" data type good choice for a field that would store integer values in most cases, but sometimes decimal values as well? Thanks,   Zlatko