PostgreSQL Source Code
git master
|
Go to the source code of this file.
Macros | |
#define | NUMERIC_MAX_PRECISION 1000 |
#define | NUMERIC_MIN_SCALE (-1000) |
#define | NUMERIC_MAX_SCALE 1000 |
#define | NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION |
#define | NUMERIC_MIN_DISPLAY_SCALE 0 |
#define | NUMERIC_MAX_RESULT_SCALE (NUMERIC_MAX_PRECISION * 2) |
#define | NUMERIC_MIN_SIG_DIGITS 16 |
#define | PG_GETARG_NUMERIC(n) DatumGetNumeric(PG_GETARG_DATUM(n)) |
#define | PG_GETARG_NUMERIC_COPY(n) DatumGetNumericCopy(PG_GETARG_DATUM(n)) |
#define | PG_RETURN_NUMERIC(x) return NumericGetDatum(x) |
Typedefs | |
typedef struct NumericData * | Numeric |
#define NUMERIC_MAX_DISPLAY_SCALE NUMERIC_MAX_PRECISION |
#define NUMERIC_MAX_RESULT_SCALE (NUMERIC_MAX_PRECISION * 2) |
#define PG_GETARG_NUMERIC | ( | n | ) | DatumGetNumeric(PG_GETARG_DATUM(n)) |
#define PG_GETARG_NUMERIC_COPY | ( | n | ) | DatumGetNumericCopy(PG_GETARG_DATUM(n)) |
#define PG_RETURN_NUMERIC | ( | x | ) | return NumericGetDatum(x) |
typedef struct NumericData* Numeric |
Definition at line 61 of file numeric.h.
References PG_DETOAST_DATUM.
Referenced by datum_to_jsonb_internal(), executeItemOptUnwrapTarget(), executeNumericItemMethod(), executeUnaryArithmExpr(), extract_date(), gbt_numeric_consistent(), gbt_numeric_penalty(), getArrayIndex(), hstore_to_jsonb_loose(), jsonb_agg_transfn_worker(), jsonb_in_scalar(), jsonb_object_agg_transfn_worker(), JsonbValueInitNumericDatum(), numeric_absolute(), numeric_fast_cmp(), numeric_half_rounded(), numeric_to_char(), numeric_to_number(), numeric_truncated_divide(), pg_size_bytes(), PLyNumber_ToJsonbValue(), SV_to_JsonbValue(), timestamp_part_common(), and timestamptz_part_common().
Definition at line 67 of file numeric.h.
References PG_DETOAST_DATUM_COPY.
Referenced by jsonb_numeric().
Numeric int64_div_fast_to_numeric | ( | int64 | val1, |
int | log10val2 | ||
) |
Definition at line 4301 of file numeric.c.
References DEC_DIGITS, NumericVar::dscale, free_var(), init_var, int64_to_numericvar(), lengthof, make_result(), mul_var(), pg_mul_s64_overflow(), res, StaticAssertDecl, unlikely, and NumericVar::weight.
Referenced by interval_part_common(), time_part_common(), timestamp_part_common(), timestamptz_part_common(), and timetz_part_common().
Numeric int64_to_numeric | ( | int64 | val | ) |
Definition at line 4280 of file numeric.c.
References free_var(), init_var, int64_to_numericvar(), make_result(), res, and val.
Referenced by cash_numeric(), executeItemOptUnwrapTarget(), executeKeyValueMethod(), extract_date(), gbt_numeric_penalty(), int2_accum(), int2_accum_inv(), int2_numeric(), int4_accum(), int4_accum_inv(), int4_numeric(), int8_accum(), int8_accum_inv(), int8_avg(), int8_avg_accum(), int8_avg_accum_inv(), int8_numeric(), int8_sum(), int8_to_char(), interval_part_common(), numeric_avg(), numeric_cash(), numeric_half_rounded(), numeric_poly_avg(), numeric_to_char(), numeric_to_number(), numeric_truncated_divide(), pg_size_bytes(), pg_size_pretty_numeric(), SV_to_JsonbValue(), time_part_common(), timestamp_part_common(), timestamptz_part_common(), and timetz_part_common().
Definition at line 2864 of file numeric.c.
References add_var(), Assert, const_nan, const_ninf, const_pinf, free_var(), init_var, init_var_from_num(), make_result(), make_result_opt_error(), NUMERIC_IS_NAN, NUMERIC_IS_NINF, NUMERIC_IS_PINF, NUMERIC_IS_SPECIAL, and res.
Referenced by executeItemOptUnwrapTarget(), interval_part_common(), numeric_add(), timestamp_part_common(), and timestamptz_part_common().
Definition at line 3141 of file numeric.c.
References Assert, const_nan, const_ninf, const_pinf, const_zero, NumericVar::digits, div_var(), ereport, errcode(), errmsg(), ERROR, free_var(), init_var, init_var_from_num(), make_result(), make_result_opt_error(), NumericVar::ndigits, NUMERIC_IS_NAN, NUMERIC_IS_NINF, NUMERIC_IS_PINF, NUMERIC_IS_SPECIAL, numeric_sign_internal(), res, and select_div_scale().
Referenced by executeItemOptUnwrapTarget(), numeric_div(), timestamp_part_common(), and timestamptz_part_common().
Definition at line 4394 of file numeric.c.
References ereport, errcode(), errmsg(), ERROR, init_var_from_num(), NUMERIC_IS_NAN, NUMERIC_IS_SPECIAL, numericvar_to_int32(), and x.
Referenced by executeDateTimeMethod(), executeItemOptUnwrapTarget(), getArrayIndex(), numeric_int4(), and numeric_to_char().
Definition at line 4482 of file numeric.c.
References ereport, errcode(), errmsg(), ERROR, init_var_from_num(), NUMERIC_IS_NAN, NUMERIC_IS_SPECIAL, numericvar_to_int64(), and x.
Referenced by executeItemOptUnwrapTarget(), and numeric_int8().
Definition at line 861 of file numeric.c.
References NUMERIC_IS_INF.
Referenced by executeItemOptUnwrapTarget(), and PLyNumber_ToJsonbValue().
Definition at line 850 of file numeric.c.
References NUMERIC_IS_NAN.
Referenced by executeItemOptUnwrapTarget(), gbt_numeric_penalty(), pg_lsn_mii(), pg_lsn_pli(), and PLyNumber_ToJsonbValue().
Definition at line 952 of file numeric.c.
References DEC_DIGITS, is_valid_numeric_typmod(), NUMERIC_HDRSZ, and numeric_typmod_precision().
Referenced by type_maximum_size().
Definition at line 3365 of file numeric.c.
References const_nan, NumericVar::digits, duplicate_numeric(), ereport, errcode(), errmsg(), ERROR, free_var(), init_var, init_var_from_num(), make_result(), make_result_opt_error(), mod_var(), NumericVar::ndigits, NUMERIC_IS_INF, NUMERIC_IS_NAN, NUMERIC_IS_SPECIAL, numeric_sign_internal(), and res.
Referenced by executeItemOptUnwrapTarget(), and numeric_mod().
Definition at line 3020 of file numeric.c.
References Assert, const_nan, const_ninf, const_pinf, NumericVar::dscale, free_var(), init_var, init_var_from_num(), make_result(), make_result_opt_error(), mul_var(), NUMERIC_DSCALE_MAX, NUMERIC_IS_NAN, NUMERIC_IS_NINF, NUMERIC_IS_PINF, NUMERIC_IS_SPECIAL, numeric_sign_internal(), res, and round_var().
Referenced by executeItemOptUnwrapTarget(), and numeric_mul().
char* numeric_normalize | ( | Numeric | num | ) |
Definition at line 1025 of file numeric.c.
References get_str_from_var(), init_var_from_num(), NUMERIC_IS_NINF, NUMERIC_IS_PINF, NUMERIC_IS_SPECIAL, pstrdup(), str, and x.
Referenced by make_scalar_key().
char* numeric_out_sci | ( | Numeric | num, |
int | scale | ||
) |
Definition at line 991 of file numeric.c.
References get_str_from_var_sci(), init_var_from_num(), NUMERIC_IS_NINF, NUMERIC_IS_PINF, NUMERIC_IS_SPECIAL, pstrdup(), scale, str, and x.
Referenced by int8_to_char(), and numeric_to_char().
Definition at line 2942 of file numeric.c.
References Assert, const_nan, const_ninf, const_pinf, free_var(), init_var, init_var_from_num(), make_result(), make_result_opt_error(), NUMERIC_IS_NAN, NUMERIC_IS_NINF, NUMERIC_IS_PINF, NUMERIC_IS_SPECIAL, res, and sub_var().
Referenced by executeItemOptUnwrapTarget(), numeric_sub(), timestamp_part_common(), and timestamptz_part_common().
Definition at line 73 of file numeric.h.
References PointerGetDatum().
Referenced by cash_numeric(), compareNumeric(), ExecGetJsonValueItemString(), executeItemOptUnwrapTarget(), executeNumericItemMethod(), executeUnaryArithmExpr(), gbt_numeric_penalty(), generate_series_step_numeric(), getArrayIndex(), gin_numeric_cmp(), int8_avg(), int8_sum(), iterate_jsonb_values(), jsonb_agg_transfn_worker(), jsonb_float4(), jsonb_float8(), jsonb_int2(), jsonb_int4(), jsonb_int8(), jsonb_numeric(), jsonb_object_agg_transfn_worker(), JsonbHashScalarValue(), JsonbHashScalarValueExtended(), JsonbValue_to_SV(), numeric_absolute(), numeric_avg(), numeric_cash(), numeric_float4(), numeric_float8(), numeric_half_rounded(), numeric_is_less(), numeric_poly_avg(), numeric_to_char(), numeric_to_cstring(), numeric_to_number(), numeric_truncated_divide(), pg_lsn_mii(), pg_lsn_pli(), pg_size_bytes(), PLyObject_FromJsonbValue(), printJsonPathItem(), timestamp_part_common(), and timestamptz_part_common().
Numeric random_numeric | ( | pg_prng_state * | state, |
Numeric | rmin, | ||
Numeric | rmax | ||
) |
Definition at line 4225 of file numeric.c.
References ereport, errcode(), errmsg(), ERROR, free_var(), init_var, init_var_from_num(), make_result(), NUMERIC_IS_NAN, NUMERIC_IS_SPECIAL, random_var(), and res.
Referenced by numeric_random().