PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <limits.h>
#include <ctype.h>
#include <math.h>
#include "common/int.h"
#include "libpq/pqformat.h"
#include "utils/builtins.h"
#include "utils/cash.h"
#include "utils/float.h"
#include "utils/numeric.h"
#include "utils/pg_locale.h"
Go to the source code of this file.
Datum cash_cmp | ( | PG_FUNCTION_ARGS | ) |
Datum cash_div_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 714 of file cash.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_CASH, and PG_RETURN_FLOAT8.
Definition at line 130 of file cash.c.
References ereport, errcode(), errmsg(), ERROR, float8_div(), FLOAT8_FITS_IN_INT64, res, and unlikely.
Referenced by cash_div_flt4(), and cash_div_flt8().
Datum cash_div_flt4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 800 of file cash.c.
References cash_div_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT4, and PG_RETURN_CASH.
Datum cash_div_flt8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 760 of file cash.c.
References cash_div_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT8, and PG_RETURN_CASH.
Datum cash_div_int2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 916 of file cash.c.
References cash_div_int64(), PG_GETARG_CASH, PG_GETARG_INT16, and PG_RETURN_CASH.
Datum cash_div_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 878 of file cash.c.
References cash_div_int64(), i, PG_GETARG_CASH, PG_GETARG_INT32, and PG_RETURN_CASH.
Definition at line 156 of file cash.c.
References ereport, errcode(), errmsg(), ERROR, i, and unlikely.
Referenced by cash_div_int2(), cash_div_int4(), and cash_div_int8().
Datum cash_div_int8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 838 of file cash.c.
References cash_div_int64(), i, PG_GETARG_CASH, PG_GETARG_INT64, and PG_RETURN_CASH.
Datum cash_eq | ( | PG_FUNCTION_ARGS | ) |
Datum cash_ge | ( | PG_FUNCTION_ARGS | ) |
Datum cash_gt | ( | PG_FUNCTION_ARGS | ) |
Datum cash_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 173 of file cash.c.
References ereturn, errcode(), errmsg(), INT64_FORMAT, PG_GETARG_CSTRING, PG_INT64_MIN, pg_mul_s64_overflow(), PG_RETURN_CASH, pg_sub_s64_overflow(), PGLC_localeconv(), printf, str, and value.
Datum cash_le | ( | PG_FUNCTION_ARGS | ) |
Datum cash_lt | ( | PG_FUNCTION_ARGS | ) |
Datum cash_mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 701 of file cash.c.
References cash_mi_cash(), PG_GETARG_CASH, and PG_RETURN_CASH.
Definition at line 117 of file cash.c.
References ereport, errcode(), errmsg(), ERROR, FLOAT8_FITS_IN_INT64, float8_mul(), res, and unlikely.
Referenced by cash_mul_flt4(), cash_mul_flt8(), flt4_mul_cash(), and flt8_mul_cash().
Datum cash_mul_flt4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 773 of file cash.c.
References cash_mul_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT4, and PG_RETURN_CASH.
Datum cash_mul_flt8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 734 of file cash.c.
References cash_mul_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT8, and PG_RETURN_CASH.
Datum cash_mul_int2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 891 of file cash.c.
References cash_mul_int64(), PG_GETARG_CASH, PG_GETARG_INT16, and PG_RETURN_CASH.
Datum cash_mul_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 851 of file cash.c.
References cash_mul_int64(), i, PG_GETARG_CASH, PG_GETARG_INT32, and PG_RETURN_CASH.
Definition at line 143 of file cash.c.
References ereport, errcode(), errmsg(), ERROR, i, pg_mul_s64_overflow(), res, and unlikely.
Referenced by cash_mul_int2(), cash_mul_int4(), cash_mul_int8(), int2_mul_cash(), int4_mul_cash(), and int8_mul_cash().
Datum cash_mul_int8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 813 of file cash.c.
References cash_mul_int64(), i, PG_GETARG_CASH, PG_GETARG_INT64, and PG_RETURN_CASH.
Datum cash_ne | ( | PG_FUNCTION_ARGS | ) |
Datum cash_numeric | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1046 of file cash.c.
References DirectFunctionCall2, i, Int32GetDatum(), int64_to_numeric(), numeric_div(), numeric_round(), numeric_scale(), NumericGetDatum(), PG_GETARG_CASH, PG_RETURN_DATUM, PGLC_localeconv(), and scale.
Datum cash_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 387 of file cash.c.
References buf, if(), PG_GETARG_CASH, PG_RETURN_CSTRING, PGLC_localeconv(), psprintf(), and value.
Datum cash_pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 688 of file cash.c.
References cash_pl_cash(), PG_GETARG_CASH, and PG_RETURN_CASH.
Datum cash_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 590 of file cash.c.
References buf, PG_GETARG_POINTER, PG_RETURN_CASH, and pq_getmsgint64().
Datum cash_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 601 of file cash.c.
References buf, PG_GETARG_CASH, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendint64().
Datum cash_words | ( | PG_FUNCTION_ARGS | ) |
Definition at line 959 of file cash.c.
References buf, cstring_to_text(), num_word(), PG_GETARG_CASH, PG_RETURN_TEXT_P, pg_toupper(), val, and value.
Datum cashlarger | ( | PG_FUNCTION_ARGS | ) |
Datum cashsmaller | ( | PG_FUNCTION_ARGS | ) |
Datum flt4_mul_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 786 of file cash.c.
References cash_mul_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT4, and PG_RETURN_CASH.
Datum flt8_mul_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 747 of file cash.c.
References cash_mul_float8(), PG_GETARG_CASH, PG_GETARG_FLOAT8, and PG_RETURN_CASH.
Datum int2_mul_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 903 of file cash.c.
References cash_mul_int64(), PG_GETARG_CASH, PG_GETARG_INT16, and PG_RETURN_CASH.
Datum int4_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1136 of file cash.c.
References DatumGetInt64(), DirectFunctionCall2, i, Int64GetDatum(), int8mul(), PG_GETARG_INT32, PG_RETURN_CASH, PGLC_localeconv(), and scale.
Datum int4_mul_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 864 of file cash.c.
References cash_mul_int64(), i, PG_GETARG_CASH, PG_GETARG_INT32, and PG_RETURN_CASH.
Datum int8_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1166 of file cash.c.
References DatumGetInt64(), DirectFunctionCall2, i, Int64GetDatum(), int8mul(), PG_GETARG_INT64, PG_RETURN_CASH, PGLC_localeconv(), and scale.
Datum int8_mul_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 826 of file cash.c.
References cash_mul_int64(), i, PG_GETARG_CASH, PG_GETARG_INT64, and PG_RETURN_CASH.
|
static |
Datum numeric_cash | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1102 of file cash.c.
References DatumGetInt64(), DirectFunctionCall1, DirectFunctionCall2, i, int64_to_numeric(), numeric_int8(), numeric_mul(), numeric_scale(), NumericGetDatum(), PG_GETARG_DATUM, PG_RETURN_CASH, PGLC_localeconv(), and scale.