413 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
414 errmsg(
"invalid preceding or following size in window function")));
448 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
449 errmsg(
"bigint out of range")));
471 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
472 errmsg(
"bigint out of range")));
485 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
486 errmsg(
"bigint out of range")));
499 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
500 errmsg(
"bigint out of range")));
514 (
errcode(ERRCODE_DIVISION_BY_ZERO),
515 errmsg(
"division by zero")));
530 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
531 errmsg(
"bigint out of range")));
538 result = arg1 / arg2;
554 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
555 errmsg(
"bigint out of range")));
556 result = (arg1 < 0) ? -arg1 : arg1;
572 (
errcode(ERRCODE_DIVISION_BY_ZERO),
573 errmsg(
"division by zero")));
622 a1 = (arg1 < 0) ? arg1 : -arg1;
623 a2 = (arg2 < 0) ? arg2 : -arg2;
636 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
637 errmsg(
"bigint out of range")));
695 if (arg1 == 0 || arg2 == 0)
704 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
705 errmsg(
"bigint out of range")));
710 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
711 errmsg(
"bigint out of range")));
729 #ifndef USE_FLOAT8_BYVAL
736 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
737 errmsg(
"bigint out of range")));
750 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
751 errmsg(
"bigint out of range")));
767 #ifndef USE_FLOAT8_BYVAL
774 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
775 errmsg(
"bigint out of range")));
787 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
788 errmsg(
"bigint out of range")));
873 result = ((arg1 > arg2) ? arg1 : arg2);
885 result = ((arg1 < arg2) ? arg1 : arg2);
899 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
900 errmsg(
"bigint out of range")));
913 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
914 errmsg(
"bigint out of range")));
927 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
928 errmsg(
"bigint out of range")));
942 (
errcode(ERRCODE_DIVISION_BY_ZERO),
943 errmsg(
"division by zero")));
958 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
959 errmsg(
"bigint out of range")));
966 result = arg1 / arg2;
980 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
981 errmsg(
"bigint out of range")));
994 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
995 errmsg(
"bigint out of range")));
1008 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1009 errmsg(
"bigint out of range")));
1022 (
errcode(ERRCODE_DIVISION_BY_ZERO),
1023 errmsg(
"division by zero")));
1041 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1042 errmsg(
"bigint out of range")));
1055 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1056 errmsg(
"bigint out of range")));
1069 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1070 errmsg(
"bigint out of range")));
1084 (
errcode(ERRCODE_DIVISION_BY_ZERO),
1085 errmsg(
"division by zero")));
1100 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1101 errmsg(
"bigint out of range")));
1108 result = arg1 / arg2;
1122 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1123 errmsg(
"bigint out of range")));
1136 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1137 errmsg(
"bigint out of range")));
1150 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1151 errmsg(
"bigint out of range")));
1164 (
errcode(ERRCODE_DIVISION_BY_ZERO),
1165 errmsg(
"division by zero")));
1256 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1257 errmsg(
"integer out of range")));
1277 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1278 errmsg(
"smallint out of range")));
1312 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1313 errmsg(
"bigint out of range")));
1347 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1348 errmsg(
"bigint out of range")));
1360 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1361 errmsg(
"OID out of range")));
1403 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1404 errmsg(
"step size cannot equal zero")));
1492 ((
Const *) arg1)->constisnull) ||
1494 ((
Const *) arg2)->constisnull) ||
1495 (arg3 != NULL &&
IsA(arg3,
Const) &&
1496 ((
Const *) arg3)->constisnull))
1503 (arg3 == NULL ||
IsA(arg3,
Const)))
1516 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)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
#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)
StringInfoData * StringInfo
MemoryContext multi_call_memory_ctx
struct PlannerInfo * root
struct WindowClause * window_clause
MonotonicFunction monotonic
static uint32 gcd(uint32 a, uint32 b)