cash_mul_int8 / cash_div_int8

Started by Kohei KaiGaiover 10 years ago4 messages
#1Kohei KaiGai
kaigai@kaigai.gr.jp

I noticed cash_mul_int8 / cash_div_int8 are defined in cash.c,
however, pg_proc.h and pg_operator.h contains no relevant entries.

Is it just a careless oversight?

Thanks,
--
KaiGai Kohei <kaigai@kaigai.gr.jp>

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kohei KaiGai (#1)
Re: cash_mul_int8 / cash_div_int8

Kohei KaiGai <kaigai@kaigai.gr.jp> writes:

I noticed cash_mul_int8 / cash_div_int8 are defined in cash.c,
however, pg_proc.h and pg_operator.h contains no relevant entries.

Is it just a careless oversight?

Hm. I'd be inclined to fix that by removing the dead code, since
it's evidently useless. For that matter, I doubt we need the int2
and flt4 variants; might as well depend on automatic promotions.

regards, tom lane

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

#3Kohei KaiGai
kaigai@kaigai.gr.jp
In reply to: Kohei KaiGai (#1)
Re: cash_mul_int8 / cash_div_int8

Also, cash_pl, cash_mi, cash_mul_int4 and so on... does not have overflow checks
like as int8pl has.

Of course, most of people don't need to worry about 64bit overflow for
money... :-).

2015-10-08 0:03 GMT+09:00 Kohei KaiGai <kaigai@kaigai.gr.jp>:

I noticed cash_mul_int8 / cash_div_int8 are defined in cash.c,
however, pg_proc.h and pg_operator.h contains no relevant entries.

Is it just a careless oversight?

Thanks,
--
KaiGai Kohei <kaigai@kaigai.gr.jp>

--
KaiGai Kohei <kaigai@kaigai.gr.jp>

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

#4Michael Paquier
michael.paquier@gmail.com
In reply to: Kohei KaiGai (#3)
Re: cash_mul_int8 / cash_div_int8

On Thu, Oct 8, 2015 at 12:11 AM, Kohei KaiGai <kaigai@kaigai.gr.jp> wrote:

Also, cash_pl, cash_mi, cash_mul_int4 and so on... does not have overflow checks
like as int8pl has.

Of course, most of people don't need to worry about 64bit overflow for
money... :-).

If you are using Zimbabwean dollar that's an issue:
https://en.wikipedia.org/wiki/Zimbabwean_dollar#Hyperinflation
--
Michael

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