PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include "catalog/pg_type.h"
#include "common/int.h"
#include "funcapi.h"
#include "libpq/pqformat.h"
#include "nodes/nodeFuncs.h"
#include "nodes/supportnodes.h"
#include "optimizer/optimizer.h"
#include "utils/array.h"
#include "utils/builtins.h"
Go to the source code of this file.
Data Structures | |
struct | generate_series_fctx |
Macros | |
#define | Int2VectorSize(n) (offsetof(int2vector, values) + (n) * sizeof(int16)) |
#define Int2VectorSize | ( | n | ) | (offsetof(int2vector, values) + (n) * sizeof(int16)) |
Definition at line 45 of file int.c.
Referenced by buildint2vector(), and int2vectorin().
Datum bool_int4 | ( | PG_FUNCTION_ARGS | ) |
int2vector* buildint2vector | ( | const int16 * | int2s, |
int | n | ||
) |
Definition at line 114 of file int.c.
References int2vector::dataoffset, int2vector::dim1, int2vector::elemtype, Int2VectorSize, int2vector::lbound1, int2vector::ndim, palloc0(), SET_VARSIZE, and int2vector::values.
Referenced by CreateStatistics(), CreateTrigger(), StorePartitionKey(), and UpdateIndexRelation().
Datum generate_series_int4 | ( | PG_FUNCTION_ARGS | ) |
Datum generate_series_int4_support | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1564 of file int.c.
References generate_unaccent_rules::args, DatumGetInt32, estimate_expression_value(), is_funcclause(), IsA, linitial, list_length(), lsecond, lthird, SupportRequestRows::node, PG_GETARG_POINTER, PG_RETURN_POINTER, SupportRequestRows::root, and SupportRequestRows::rows.
Datum generate_series_step_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1488 of file int.c.
References generate_series_fctx::current, ereport, errcode(), errmsg(), ERROR, generate_series_fctx::finish, Int32GetDatum, MemoryContextSwitchTo(), FuncCallContext::multi_call_memory_ctx, palloc(), pg_add_s32_overflow(), PG_GETARG_INT32, PG_NARGS, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, generate_series_fctx::step, and FuncCallContext::user_fctx.
Referenced by generate_series_int4().
Datum i2toi4 | ( | PG_FUNCTION_ARGS | ) |
Datum i4toi2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 327 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT32, PG_RETURN_INT16, and unlikely.
Datum in_range_int2_int2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 718 of file int.c.
References DirectFunctionCall5, in_range_int2_int4(), Int32GetDatum, PG_GETARG_DATUM, and PG_GETARG_INT16.
Datum in_range_int2_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 683 of file int.c.
References ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), PG_GETARG_BOOL, PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_BOOL, unlikely, and val.
Referenced by in_range_int2_int2().
Datum in_range_int2_int8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 730 of file int.c.
References DirectFunctionCall5, in_range_int4_int8(), Int32GetDatum, PG_GETARG_DATUM, and PG_GETARG_INT16.
Datum in_range_int4_int2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 636 of file int.c.
References DirectFunctionCall5, in_range_int4_int4(), Int32GetDatum, PG_GETARG_DATUM, and PG_GETARG_INT16.
Datum in_range_int4_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 602 of file int.c.
References ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), PG_GETARG_BOOL, PG_GETARG_INT32, PG_RETURN_BOOL, unlikely, and val.
Referenced by in_range_int4_int2().
Datum in_range_int4_int8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 648 of file int.c.
References ereport, errcode(), errmsg(), ERROR, pg_add_s64_overflow(), PG_GETARG_BOOL, PG_GETARG_INT32, PG_GETARG_INT64, PG_RETURN_BOOL, unlikely, and val.
Referenced by in_range_int2_int8().
Datum int24div | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1009 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_INT32, PG_RETURN_NULL, and unlikely.
Datum int24eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 483 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 528 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 519 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 510 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 501 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 981 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_INT32, pg_sub_s32_overflow(), and unlikely.
Datum int24mul | ( | PG_FUNCTION_ARGS | ) |
Definition at line 995 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_GETARG_INT32, pg_mul_s32_overflow(), PG_RETURN_INT32, and unlikely.
Datum int24ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 492 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 967 of file int.c.
References ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_INT32, and unlikely.
Datum int2abs | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1184 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_INT16_MIN, PG_RETURN_INT16, and unlikely.
Datum int2and | ( | PG_FUNCTION_ARGS | ) |
Datum int2div | ( | PG_FUNCTION_ARGS | ) |
Definition at line 928 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_INT16_MIN, PG_RETURN_INT16, PG_RETURN_NULL, and unlikely.
Datum int2eq | ( | PG_FUNCTION_ARGS | ) |
Datum int2ge | ( | PG_FUNCTION_ARGS | ) |
Datum int2gt | ( | PG_FUNCTION_ARGS | ) |
Datum int2in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 63 of file int.c.
References PG_GETARG_CSTRING, PG_RETURN_INT16, and pg_strtoint16().
Datum int2larger | ( | PG_FUNCTION_ARGS | ) |
Datum int2le | ( | PG_FUNCTION_ARGS | ) |
Datum int2lt | ( | PG_FUNCTION_ARGS | ) |
Datum int2mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 899 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_RETURN_INT16, pg_sub_s16_overflow(), and unlikely.
Datum int2mod | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1137 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_RETURN_INT16, PG_RETURN_NULL, and unlikely.
Datum int2mul | ( | PG_FUNCTION_ARGS | ) |
Definition at line 913 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, pg_mul_s16_overflow(), PG_RETURN_INT16, and unlikely.
Datum int2ne | ( | PG_FUNCTION_ARGS | ) |
Datum int2not | ( | PG_FUNCTION_ARGS | ) |
Datum int2or | ( | PG_FUNCTION_ARGS | ) |
Datum int2out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 74 of file int.c.
References palloc(), PG_GETARG_INT16, pg_itoa(), and PG_RETURN_CSTRING.
Datum int2pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 885 of file int.c.
References ereport, errcode(), errmsg(), ERROR, pg_add_s16_overflow(), PG_GETARG_INT16, PG_RETURN_INT16, and unlikely.
Datum int2recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 87 of file int.c.
References buf, PG_GETARG_POINTER, PG_RETURN_INT16, and pq_getmsgint().
Datum int2send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 98 of file int.c.
References buf, PG_GETARG_INT16, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendint16().
Datum int2shl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1461 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_INT16.
Datum int2shr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1470 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_INT16.
Datum int2smaller | ( | PG_FUNCTION_ARGS | ) |
Datum int2um | ( | PG_FUNCTION_ARGS | ) |
Definition at line 865 of file int.c.
References arg, ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_INT16_MIN, PG_RETURN_INT16, and unlikely.
Datum int2up | ( | PG_FUNCTION_ARGS | ) |
Datum int2vectorin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 141 of file int.c.
References int2vector::dataoffset, int2vector::dim1, int2vector::elemtype, ereport, errcode(), errmsg(), ERROR, FUNC_MAX_ARGS, Int2VectorSize, int2vector::lbound1, int2vector::ndim, palloc0(), pg_atoi(), PG_GETARG_CSTRING, PG_RETURN_POINTER, SET_VARSIZE, and int2vector::values.
Datum int2vectorout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 180 of file int.c.
References int2vector::dim1, palloc(), PG_GETARG_POINTER, pg_itoa(), PG_RETURN_CSTRING, and int2vector::values.
Datum int2vectorrecv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 204 of file int.c.
References ARR_DIMS, ARR_ELEMTYPE, ARR_HASNULL, ARR_LBOUND, ARR_NDIM, array_recv(), Assert, buf, DatumGetPointer, ereport, errcode(), errmsg(), ERROR, FUNC_MAX_ARGS, InitFunctionCallInfoData, Int32GetDatum, InvalidOid, LOCAL_FCINFO, ObjectIdGetDatum, PG_GETARG_POINTER, PG_RETURN_POINTER, and PointerGetDatum.
Datum int2vectorsend | ( | PG_FUNCTION_ARGS | ) |
Datum int2xor | ( | PG_FUNCTION_ARGS | ) |
Datum int42div | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1070 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_GETARG_INT32, PG_INT32_MIN, PG_RETURN_INT32, PG_RETURN_NULL, and unlikely.
Datum int42eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 537 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 582 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 573 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 564 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 555 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1042 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_INT32, pg_sub_s32_overflow(), and unlikely.
Datum int42mul | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1056 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT16, PG_GETARG_INT32, pg_mul_s32_overflow(), PG_RETURN_INT32, and unlikely.
Datum int42ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 546 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1028 of file int.c.
References ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_INT32, and unlikely.
Datum int4_bool | ( | PG_FUNCTION_ARGS | ) |
Datum int4abs | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1170 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT32, PG_INT32_MIN, PG_RETURN_INT32, and unlikely.
Datum int4and | ( | PG_FUNCTION_ARGS | ) |
Datum int4div | ( | PG_FUNCTION_ARGS | ) |
Definition at line 812 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT32, PG_INT32_MIN, PG_RETURN_INT32, PG_RETURN_NULL, and unlikely.
Datum int4eq | ( | PG_FUNCTION_ARGS | ) |
Datum int4gcd | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1273 of file int.c.
References int4gcd_internal(), PG_GETARG_INT32, and PG_RETURN_INT32.
Datum int4ge | ( | PG_FUNCTION_ARGS | ) |
Datum int4gt | ( | PG_FUNCTION_ARGS | ) |
Datum int4in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 266 of file int.c.
References PG_GETARG_CSTRING, PG_RETURN_INT32, and pg_strtoint32().
Referenced by inet_client_port(), inet_server_port(), and pg_stat_get_backend_client_port().
Datum int4inc | ( | PG_FUNCTION_ARGS | ) |
Definition at line 851 of file int.c.
References arg, ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), PG_GETARG_INT32, PG_RETURN_INT32, and unlikely.
Datum int4larger | ( | PG_FUNCTION_ARGS | ) |
Datum int4lcm | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1288 of file int.c.
References ereport, errcode(), errmsg(), ERROR, gcd(), int4gcd_internal(), PG_GETARG_INT32, PG_INT32_MIN, pg_mul_s32_overflow(), PG_RETURN_INT32, and unlikely.
Datum int4le | ( | PG_FUNCTION_ARGS | ) |
Datum int4lt | ( | PG_FUNCTION_ARGS | ) |
Datum int4mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 784 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT32, PG_RETURN_INT32, pg_sub_s32_overflow(), and unlikely.
Datum int4mod | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1109 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT32, PG_RETURN_INT32, PG_RETURN_NULL, and unlikely.
Datum int4mul | ( | PG_FUNCTION_ARGS | ) |
Definition at line 798 of file int.c.
References ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT32, pg_mul_s32_overflow(), PG_RETURN_INT32, and unlikely.
Datum int4ne | ( | PG_FUNCTION_ARGS | ) |
Datum int4not | ( | PG_FUNCTION_ARGS | ) |
Datum int4or | ( | PG_FUNCTION_ARGS | ) |
Datum int4out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 277 of file int.c.
References palloc(), PG_GETARG_INT32, pg_ltoa(), and PG_RETURN_CSTRING.
Referenced by int4_to_char().
Datum int4pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 770 of file int.c.
References ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), PG_GETARG_INT32, PG_RETURN_INT32, and unlikely.
Referenced by int4range_canonical().
Datum int4recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 290 of file int.c.
References buf, PG_GETARG_POINTER, PG_RETURN_INT32, and pq_getmsgint().
Datum int4send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 301 of file int.c.
References buf, PG_GETARG_INT32, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendint32().
Datum int4shl | ( | PG_FUNCTION_ARGS | ) |
Datum int4shr | ( | PG_FUNCTION_ARGS | ) |
Datum int4smaller | ( | PG_FUNCTION_ARGS | ) |
Datum int4um | ( | PG_FUNCTION_ARGS | ) |
Definition at line 750 of file int.c.
References arg, ereport, errcode(), errmsg(), ERROR, PG_GETARG_INT32, PG_INT32_MIN, PG_RETURN_INT32, and unlikely.
Datum int4up | ( | PG_FUNCTION_ARGS | ) |
Datum int4xor | ( | PG_FUNCTION_ARGS | ) |