45 #define Int2VectorSize(n) (offsetof(int2vector, values) + (n) * sizeof(int16)) 77 char *result = (
char *)
palloc(7);
151 while (*intString && isspace((
unsigned char) *intString))
153 if (*intString ==
'\0')
156 while (*intString && !isspace((
unsigned char) *intString))
159 while (*intString && isspace((
unsigned char) *intString))
163 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
164 errmsg(
"int2vector has too many elements")));
184 nnums = int2Array->
dim1;
189 rp = result = (
char *)
palloc(nnums * 7 + 1);
190 for (num = 0; num < nnums; num++)
220 locfcinfo->args[0].isnull =
false;
222 locfcinfo->args[1].isnull =
false;
224 locfcinfo->args[2].isnull =
false;
228 Assert(!locfcinfo->isnull);
236 (
errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
237 errmsg(
"invalid int2vector data")));
242 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
243 errmsg(
"oidvector has too many elements")));
280 char *result = (
char *)
palloc(12);
333 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
334 errmsg(
"smallint out of range")));
613 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
614 errmsg(
"invalid preceding or following size in window function")));
660 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
661 errmsg(
"invalid preceding or following size in window function")));
695 (
errcode(ERRCODE_INVALID_PRECEDING_OR_FOLLOWING_SIZE),
696 errmsg(
"invalid preceding or following size in window function")));
756 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
757 errmsg(
"integer out of range")));
778 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
779 errmsg(
"integer out of range")));
792 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
793 errmsg(
"integer out of range")));
806 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
807 errmsg(
"integer out of range")));
821 (
errcode(ERRCODE_DIVISION_BY_ZERO),
822 errmsg(
"division by zero")));
837 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
838 errmsg(
"integer out of range")));
845 result = arg1 / arg2;
858 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
859 errmsg(
"integer out of range")));
871 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
872 errmsg(
"smallint out of range")));
893 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
894 errmsg(
"smallint out of range")));
907 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
908 errmsg(
"smallint out of range")));
921 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
922 errmsg(
"smallint out of range")));
937 (
errcode(ERRCODE_DIVISION_BY_ZERO),
938 errmsg(
"division by zero")));
953 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
954 errmsg(
"smallint out of range")));
961 result = arg1 / arg2;
975 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
976 errmsg(
"integer out of range")));
989 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
990 errmsg(
"integer out of range")));
1003 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1004 errmsg(
"integer out of range")));
1017 (
errcode(ERRCODE_DIVISION_BY_ZERO),
1018 errmsg(
"division by zero")));
1036 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1037 errmsg(
"integer out of range")));
1050 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1051 errmsg(
"integer out of range")));
1064 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1065 errmsg(
"integer out of range")));
1079 (
errcode(ERRCODE_DIVISION_BY_ZERO),
1080 errmsg(
"division by zero")));
1095 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1096 errmsg(
"integer out of range")));
1103 result = arg1 / arg2;
1117 (
errcode(ERRCODE_DIVISION_BY_ZERO),
1118 errmsg(
"division by zero")));
1145 (
errcode(ERRCODE_DIVISION_BY_ZERO),
1146 errmsg(
"division by zero")));
1177 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1178 errmsg(
"integer out of range")));
1179 result = (arg1 < 0) ? -arg1 : arg1;
1191 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1192 errmsg(
"smallint out of range")));
1193 result = (arg1 < 0) ? -arg1 : arg1;
1227 a1 = (arg1 < 0) ? arg1 : -arg1;
1228 a2 = (arg2 < 0) ? arg2 : -arg2;
1241 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1242 errmsg(
"integer out of range")));
1300 if (arg1 == 0 || arg2 == 0)
1309 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1310 errmsg(
"integer out of range")));
1315 (
errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
1316 errmsg(
"integer out of range")));
1507 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
1508 errmsg(
"step size cannot equal zero")));
1596 ((
Const *) arg1)->constisnull) ||
1598 ((
Const *) arg2)->constisnull) ||
1599 (arg3 != NULL &&
IsA(arg3,
Const) &&
1600 ((
Const *) arg3)->constisnull))
1607 (arg3 == NULL ||
IsA(arg3,
Const)))
1620 req->
rows = floor((finish - start + step) / step);
Datum int2not(PG_FUNCTION_ARGS)
#define PG_RETURN_POINTER(x)
#define PG_GETARG_INT32(n)
#define IsA(nodeptr, _type_)
Datum array_send(PG_FUNCTION_ARGS)
Datum int2shr(PG_FUNCTION_ARGS)
Datum int24mi(PG_FUNCTION_ARGS)
Datum int2mod(PG_FUNCTION_ARGS)
Datum int2vectorout(PG_FUNCTION_ARGS)
Datum int4inc(PG_FUNCTION_ARGS)
Datum int24gt(PG_FUNCTION_ARGS)
static bool pg_mul_s32_overflow(int32 a, int32 b, int32 *result)
Node * estimate_expression_value(PlannerInfo *root, Node *node)
Datum int42eq(PG_FUNCTION_ARGS)
Datum int24ge(PG_FUNCTION_ARGS)
#define SRF_IS_FIRSTCALL()
#define PointerGetDatum(X)
#define PG_GETARG_DATUM(n)
Datum in_range_int4_int8(PG_FUNCTION_ARGS)
Datum int2ge(PG_FUNCTION_ARGS)
Datum int4mod(PG_FUNCTION_ARGS)
Datum int42lt(PG_FUNCTION_ARGS)
int2vector * buildint2vector(const int16 *int2s, int n)
Datum int4and(PG_FUNCTION_ARGS)
Datum int4in(PG_FUNCTION_ARGS)
StringInfoData * StringInfo
Datum int2and(PG_FUNCTION_ARGS)
Datum int24ne(PG_FUNCTION_ARGS)
Datum int4lcm(PG_FUNCTION_ARGS)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
#define PG_RETURN_INT32(x)
Datum int24mul(PG_FUNCTION_ARGS)
#define PG_RETURN_INT16(x)
Datum generate_series_int4(PG_FUNCTION_ARGS)
int errcode(int sqlerrcode)
Datum int2xor(PG_FUNCTION_ARGS)
Datum int4up(PG_FUNCTION_ARGS)
Datum int4ne(PG_FUNCTION_ARGS)
#define PG_GETARG_POINTER(n)
static bool pg_add_s16_overflow(int16 a, int16 b, int16 *result)
Datum in_range_int4_int2(PG_FUNCTION_ARGS)
Datum int2vectorsend(PG_FUNCTION_ARGS)
Datum array_recv(PG_FUNCTION_ARGS)
#define PG_GETARG_BOOL(n)
#define PG_RETURN_BYTEA_P(x)
Datum int4gcd(PG_FUNCTION_ARGS)
#define SRF_PERCALL_SETUP()
Datum i2toi4(PG_FUNCTION_ARGS)
Datum int4_bool(PG_FUNCTION_ARGS)
static bool pg_mul_s16_overflow(int16 a, int16 b, int16 *result)
Datum int2lt(PG_FUNCTION_ARGS)
Datum int4pl(PG_FUNCTION_ARGS)
Datum int24div(PG_FUNCTION_ARGS)
Datum int4send(PG_FUNCTION_ARGS)
static bool is_funcclause(const void *clause)
Datum int24eq(PG_FUNCTION_ARGS)
struct PlannerInfo * root
Datum int2up(PG_FUNCTION_ARGS)
#define SRF_RETURN_NEXT(_funcctx, _result)
static const FormData_pg_attribute a2
Datum generate_series_int4_support(PG_FUNCTION_ARGS)
#define ObjectIdGetDatum(X)
Datum int2vectorrecv(PG_FUNCTION_ARGS)
Datum int4abs(PG_FUNCTION_ARGS)
Datum int2send(PG_FUNCTION_ARGS)
Datum int42gt(PG_FUNCTION_ARGS)
Datum int4ge(PG_FUNCTION_ARGS)
Datum int4lt(PG_FUNCTION_ARGS)
Datum int4mi(PG_FUNCTION_ARGS)
Datum int2smaller(PG_FUNCTION_ARGS)
Datum int4larger(PG_FUNCTION_ARGS)
Datum int2mul(PG_FUNCTION_ARGS)
int16 pg_strtoint16(const char *s)
static bool pg_sub_s32_overflow(int32 a, int32 b, int32 *result)
Datum int2eq(PG_FUNCTION_ARGS)
Datum int4out(PG_FUNCTION_ARGS)
Datum int4not(PG_FUNCTION_ARGS)
Datum in_range_int4_int4(PG_FUNCTION_ARGS)
Datum int2vectorin(PG_FUNCTION_ARGS)
Datum in_range_int2_int4(PG_FUNCTION_ARGS)
Datum int42mul(PG_FUNCTION_ARGS)
Datum int4shl(PG_FUNCTION_ARGS)
#define DirectFunctionCall5(func, arg1, arg2, arg3, arg4, arg5)
Datum int24lt(PG_FUNCTION_ARGS)
Datum int4um(PG_FUNCTION_ARGS)
void * palloc0(Size size)
#define PG_RETURN_BOOL(x)
Datum int4or(PG_FUNCTION_ARGS)
Datum int4le(PG_FUNCTION_ARGS)
Datum int4xor(PG_FUNCTION_ARGS)
#define PG_GETARG_INT16(n)
Datum bool_int4(PG_FUNCTION_ARGS)
Datum i4toi2(PG_FUNCTION_ARGS)
static bool pg_add_s64_overflow(int64 a, int64 b, int64 *result)
#define ereport(elevel,...)
Datum int24le(PG_FUNCTION_ARGS)
Datum int2larger(PG_FUNCTION_ARGS)
Datum int2out(PG_FUNCTION_ARGS)
#define LOCAL_FCINFO(name, nargs)
Datum int4div(PG_FUNCTION_ARGS)
Datum in_range_int2_int2(PG_FUNCTION_ARGS)
Datum int2div(PG_FUNCTION_ARGS)
Datum int42div(PG_FUNCTION_ARGS)
#define Assert(condition)
Datum int2mi(PG_FUNCTION_ARGS)
Datum int2ne(PG_FUNCTION_ARGS)
static bool pg_sub_s16_overflow(int16 a, int16 b, int16 *result)
static bool pg_add_s32_overflow(int32 a, int32 b, int32 *result)
#define PG_RETURN_CSTRING(x)
MemoryContext multi_call_memory_ctx
Datum int2shl(PG_FUNCTION_ARGS)
Datum int4mul(PG_FUNCTION_ARGS)
#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)
Datum int2or(PG_FUNCTION_ARGS)
static int list_length(const List *l)
int16 values[FLEXIBLE_ARRAY_MEMBER]
Datum int2in(PG_FUNCTION_ARGS)
#define Int2VectorSize(n)
int32 pg_strtoint32(const char *s)
#define DatumGetPointer(X)
static int32 int4gcd_internal(int32 arg1, int32 arg2)
int pg_ltoa(int32 value, char *a)
Datum int42ne(PG_FUNCTION_ARGS)
Datum int2recv(PG_FUNCTION_ARGS)
Datum int2um(PG_FUNCTION_ARGS)
Datum int4gt(PG_FUNCTION_ARGS)
int errmsg(const char *fmt,...)
Datum in_range_int2_int8(PG_FUNCTION_ARGS)
Datum int2abs(PG_FUNCTION_ARGS)
Datum int42ge(PG_FUNCTION_ARGS)
Datum int2pl(PG_FUNCTION_ARGS)
static uint32 gcd(uint32 a, uint32 b)
#define PG_GETARG_CSTRING(n)
Datum int42pl(PG_FUNCTION_ARGS)
#define SET_VARSIZE(PTR, len)
static const FormData_pg_attribute a1
Datum int4shr(PG_FUNCTION_ARGS)
Datum int4smaller(PG_FUNCTION_ARGS)
#define PG_GETARG_INT64(n)
Datum generate_series_step_int4(PG_FUNCTION_ARGS)
Datum int4eq(PG_FUNCTION_ARGS)
Datum int42mi(PG_FUNCTION_ARGS)
Datum int24pl(PG_FUNCTION_ARGS)
Datum int2gt(PG_FUNCTION_ARGS)
int32 pg_atoi(const char *s, int size, int c)
Datum int42le(PG_FUNCTION_ARGS)
int pg_itoa(int16 i, char *a)
#define SRF_RETURN_DONE(_funcctx)
Datum int2le(PG_FUNCTION_ARGS)
#define SRF_FIRSTCALL_INIT()
Datum int4recv(PG_FUNCTION_ARGS)