412 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
413 errmsg(
"invalid preceding or following size in window function")));
447 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
448 errmsg(
"bigint out of range")));
470 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
471 errmsg(
"bigint out of range")));
484 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
485 errmsg(
"bigint out of range")));
498 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
499 errmsg(
"bigint out of range")));
513 (
errcode(ERRCODE_DIVISION_BY_ZERO),
514 errmsg(
"division by zero")));
529 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
530 errmsg(
"bigint out of range")));
537 result = arg1 / arg2;
553 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
554 errmsg(
"bigint out of range")));
555 result = (arg1 < 0) ? -arg1 : arg1;
571 (
errcode(ERRCODE_DIVISION_BY_ZERO),
572 errmsg(
"division by zero")));
621 a1 = (arg1 < 0) ? arg1 : -arg1;
622 a2 = (arg2 < 0) ? arg2 : -arg2;
635 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
636 errmsg(
"bigint out of range")));
694 if (arg1 == 0 || arg2 == 0)
703 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
704 errmsg(
"bigint out of range")));
709 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
710 errmsg(
"bigint out of range")));
728 #ifndef USE_FLOAT8_BYVAL
735 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
736 errmsg(
"bigint out of range")));
749 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
750 errmsg(
"bigint out of range")));
766 #ifndef USE_FLOAT8_BYVAL
773 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
774 errmsg(
"bigint out of range")));
786 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
787 errmsg(
"bigint out of range")));
872 result = ((arg1 > arg2) ? arg1 : arg2);
884 result = ((arg1 < arg2) ? arg1 : arg2);
898 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
899 errmsg(
"bigint out of range")));
912 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
913 errmsg(
"bigint out of range")));
926 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
927 errmsg(
"bigint out of range")));
941 (
errcode(ERRCODE_DIVISION_BY_ZERO),
942 errmsg(
"division by zero")));
957 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
958 errmsg(
"bigint out of range")));
965 result = arg1 / arg2;
979 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
980 errmsg(
"bigint out of range")));
993 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
994 errmsg(
"bigint out of range")));
1007 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1008 errmsg(
"bigint out of range")));
1021 (
errcode(ERRCODE_DIVISION_BY_ZERO),
1022 errmsg(
"division by zero")));
1040 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1041 errmsg(
"bigint out of range")));
1054 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1055 errmsg(
"bigint out of range")));
1068 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1069 errmsg(
"bigint out of range")));
1083 (
errcode(ERRCODE_DIVISION_BY_ZERO),
1084 errmsg(
"division by zero")));
1099 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1100 errmsg(
"bigint out of range")));
1107 result = arg1 / arg2;
1121 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1122 errmsg(
"bigint out of range")));
1135 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1136 errmsg(
"bigint out of range")));
1149 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1150 errmsg(
"bigint out of range")));
1163 (
errcode(ERRCODE_DIVISION_BY_ZERO),
1164 errmsg(
"division by zero")));
1255 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1256 errmsg(
"integer out of range")));
1276 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1277 errmsg(
"smallint out of range")));
1311 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1312 errmsg(
"bigint out of range")));
1346 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1347 errmsg(
"bigint out of range")));
1359 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1360 errmsg(
"OID out of range")));
1402 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1403 errmsg(
"step size cannot equal zero")));
1491 ((
Const *) arg1)->constisnull) ||
1493 ((
Const *) arg2)->constisnull) ||
1494 (arg3 != NULL &&
IsA(arg3,
Const) &&
1495 ((
Const *) arg3)->constisnull))
1502 (arg3 == NULL ||
IsA(arg3,
Const)))
1515 req->
rows = floor((finish -
start + step) / step);
#define FLOAT4_FITS_IN_INT64(num)
#define FLOAT8_FITS_IN_INT64(num)
Node * estimate_expression_value(PlannerInfo *root, Node *node)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
Datum Int64GetDatum(int64 X)
#define PG_RETURN_BYTEA_P(x)
#define PG_GETARG_FLOAT8(n)
#define PG_RETURN_FLOAT8(x)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_CSTRING(x)
#define PG_RETURN_INT64(x)
#define PG_GETARG_CSTRING(n)
#define PG_GETARG_INT64(n)
#define PG_RETURN_INT16(x)
#define PG_RETURN_INT32(x)
#define PG_GETARG_INT32(n)
#define PG_GETARG_BOOL(n)
#define PG_GETARG_FLOAT4(n)
#define PG_RETURN_POINTER(x)
#define PG_RETURN_FLOAT4(x)
#define PG_RETURN_BOOL(x)
#define PG_GETARG_INT16(n)
#define SRF_IS_FIRSTCALL()
#define SRF_PERCALL_SETUP()
#define SRF_RETURN_NEXT(_funcctx, _result)
#define SRF_FIRSTCALL_INIT()
#define SRF_RETURN_DONE(_funcctx)
static const FormData_pg_attribute a1
static const FormData_pg_attribute a2
Datum int8lcm(PG_FUNCTION_ARGS)
Datum int84div(PG_FUNCTION_ARGS)
Datum int8ge(PG_FUNCTION_ARGS)
Datum i8tooid(PG_FUNCTION_ARGS)
Datum int8dec_any(PG_FUNCTION_ARGS)
Datum in_range_int8_int8(PG_FUNCTION_ARGS)
Datum int8abs(PG_FUNCTION_ARGS)
Datum int48ge(PG_FUNCTION_ARGS)
Datum int82le(PG_FUNCTION_ARGS)
Datum int28lt(PG_FUNCTION_ARGS)
Datum int84pl(PG_FUNCTION_ARGS)
Datum int48pl(PG_FUNCTION_ARGS)
Datum int8out(PG_FUNCTION_ARGS)
Datum int82mi(PG_FUNCTION_ARGS)
Datum int84gt(PG_FUNCTION_ARGS)
Datum int28ne(PG_FUNCTION_ARGS)
Datum int8send(PG_FUNCTION_ARGS)
Datum int8ne(PG_FUNCTION_ARGS)
Datum int84(PG_FUNCTION_ARGS)
Datum int8mul(PG_FUNCTION_ARGS)
Datum int84ge(PG_FUNCTION_ARGS)
Datum int48lt(PG_FUNCTION_ARGS)
Datum int8gcd(PG_FUNCTION_ARGS)
Datum int8not(PG_FUNCTION_ARGS)
Datum int8le(PG_FUNCTION_ARGS)
Datum int8lt(PG_FUNCTION_ARGS)
Datum int48eq(PG_FUNCTION_ARGS)
Datum generate_series_step_int8(PG_FUNCTION_ARGS)
Datum generate_series_int8(PG_FUNCTION_ARGS)
Datum int8eq(PG_FUNCTION_ARGS)
Datum generate_series_int8_support(PG_FUNCTION_ARGS)
Datum int82div(PG_FUNCTION_ARGS)
Datum int48le(PG_FUNCTION_ARGS)
Datum int28gt(PG_FUNCTION_ARGS)
Datum i8tod(PG_FUNCTION_ARGS)
Datum int8inc_support(PG_FUNCTION_ARGS)
Datum int8in(PG_FUNCTION_ARGS)
Datum int8mod(PG_FUNCTION_ARGS)
Datum oidtoi8(PG_FUNCTION_ARGS)
Datum int28pl(PG_FUNCTION_ARGS)
Datum int84eq(PG_FUNCTION_ARGS)
Datum int28div(PG_FUNCTION_ARGS)
Datum int8pl(PG_FUNCTION_ARGS)
Datum int8larger(PG_FUNCTION_ARGS)
Datum int8xor(PG_FUNCTION_ARGS)
Datum int28(PG_FUNCTION_ARGS)
Datum int8gt(PG_FUNCTION_ARGS)
Datum int8div(PG_FUNCTION_ARGS)
Datum int48ne(PG_FUNCTION_ARGS)
Datum int82pl(PG_FUNCTION_ARGS)
Datum int48mul(PG_FUNCTION_ARGS)
Datum int48mi(PG_FUNCTION_ARGS)
Datum int8up(PG_FUNCTION_ARGS)
Datum int8smaller(PG_FUNCTION_ARGS)
Datum int28le(PG_FUNCTION_ARGS)
static int64 int8gcd_internal(int64 arg1, int64 arg2)
Datum int82lt(PG_FUNCTION_ARGS)
Datum int82gt(PG_FUNCTION_ARGS)
Datum int82mul(PG_FUNCTION_ARGS)
Datum dtoi8(PG_FUNCTION_ARGS)
Datum int82ge(PG_FUNCTION_ARGS)
Datum int48div(PG_FUNCTION_ARGS)
Datum int8inc_any(PG_FUNCTION_ARGS)
Datum int48gt(PG_FUNCTION_ARGS)
Datum int8or(PG_FUNCTION_ARGS)
Datum int48(PG_FUNCTION_ARGS)
Datum int8shr(PG_FUNCTION_ARGS)
Datum int8recv(PG_FUNCTION_ARGS)
Datum int84le(PG_FUNCTION_ARGS)
Datum int8dec(PG_FUNCTION_ARGS)
Datum int84mi(PG_FUNCTION_ARGS)
Datum int82ne(PG_FUNCTION_ARGS)
Datum int82(PG_FUNCTION_ARGS)
Datum int8inc_float8_float8(PG_FUNCTION_ARGS)
Datum int28ge(PG_FUNCTION_ARGS)
Datum int8shl(PG_FUNCTION_ARGS)
Datum i8tof(PG_FUNCTION_ARGS)
Datum int82eq(PG_FUNCTION_ARGS)
Datum int84ne(PG_FUNCTION_ARGS)
Datum int8mi(PG_FUNCTION_ARGS)
Datum ftoi8(PG_FUNCTION_ARGS)
Datum int8and(PG_FUNCTION_ARGS)
Datum int84mul(PG_FUNCTION_ARGS)
Datum int8um(PG_FUNCTION_ARGS)
Datum int28mi(PG_FUNCTION_ARGS)
Datum int84lt(PG_FUNCTION_ARGS)
Datum int28eq(PG_FUNCTION_ARGS)
Datum int28mul(PG_FUNCTION_ARGS)
Datum int8inc(PG_FUNCTION_ARGS)
static bool pg_mul_s64_overflow(int64 a, int64 b, int64 *result)
static bool pg_sub_s64_overflow(int64 a, int64 b, int64 *result)
static bool pg_add_s64_overflow(int64 a, int64 b, int64 *result)
int AggCheckCallContext(FunctionCallInfo fcinfo, MemoryContext *aggcontext)
static bool is_funcclause(const void *clause)
#define IsA(nodeptr, _type_)
int64 pg_strtoint64_safe(const char *s, Node *escontext)
int pg_lltoa(int64 value, char *a)
#define FRAMEOPTION_START_UNBOUNDED_PRECEDING
#define FRAMEOPTION_END_UNBOUNDED_FOLLOWING
static int list_length(const List *l)
@ MONOTONICFUNC_DECREASING
@ MONOTONICFUNC_INCREASING
static int64 DatumGetInt64(Datum X)
MemoryContextSwitchTo(old_ctx)
StringInfoData * StringInfo
MemoryContext multi_call_memory_ctx
struct PlannerInfo * root
struct WindowClause * window_clause
MonotonicFunction monotonic
static uint32 gcd(uint32 a, uint32 b)