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)) |
Datum bool_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 372 of file int.c.
References PG_GETARG_BOOL, and PG_RETURN_INT32.
Referenced by ExecEvalJsonCoercion().
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 attnumstoint2vector(), CreateStatistics(), CreateTriggerFiringOn(), pg_get_publication_tables(), StorePartitionKey(), and UpdateIndexRelation().
Datum generate_series_int4 | ( | PG_FUNCTION_ARGS | ) |
Datum generate_series_int4_support | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1585 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, SupportRequestRows::rows, and start.
Datum generate_series_step_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1509 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, start, 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 348 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 739 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 704 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 751 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 657 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 623 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 669 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 1030 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 504 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 549 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 540 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 531 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 522 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1002 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 1016 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 513 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int24pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 988 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 1205 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 949 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_safe().
Datum int2larger | ( | PG_FUNCTION_ARGS | ) |
Datum int2le | ( | PG_FUNCTION_ARGS | ) |
Datum int2lt | ( | PG_FUNCTION_ARGS | ) |
Datum int2mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 920 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 1158 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 934 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 | ) |
Definition at line 1473 of file int.c.
References PG_GETARG_INT16, and PG_RETURN_INT16.
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 906 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 1482 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_INT16.
Datum int2shr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1491 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 886 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 | ) |
Definition at line 898 of file int.c.
References arg, PG_GETARG_INT16, and PG_RETURN_INT16.
Datum int2vectorin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 141 of file int.c.
References int2vector::dataoffset, int2vector::dim1, int2vector::elemtype, ereturn, errcode(), errmsg(), Int2VectorSize, int2vector::lbound1, int2vector::ndim, palloc0(), PG_GETARG_CSTRING, PG_RETURN_POINTER, repalloc(), SET_VARSIZE, and int2vector::values.
Datum int2vectorout | ( | PG_FUNCTION_ARGS | ) |
Definition at line 207 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 231 of file int.c.
References ARR_ELEMTYPE, ARR_HASNULL, ARR_LBOUND, ARR_NDIM, array_recv(), Assert, buf, DatumGetPointer(), ereport, errcode(), errmsg(), ERROR, 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 1091 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 558 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 603 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 594 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 585 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 576 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1063 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 1077 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 567 of file int.c.
References PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
Datum int42pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1049 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 1191 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 833 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 1294 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 287 of file int.c.
References PG_GETARG_CSTRING, PG_RETURN_INT32, and pg_strtoint32_safe().
Referenced by executeItemOptUnwrapTarget(), inet_client_port(), inet_server_port(), and pg_stat_get_backend_client_port().
Datum int4inc | ( | PG_FUNCTION_ARGS | ) |
Definition at line 872 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 1309 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 805 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 1130 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 819 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 | ) |
Definition at line 1438 of file int.c.
References PG_GETARG_INT32, and PG_RETURN_INT32.
Datum int4or | ( | PG_FUNCTION_ARGS | ) |
Datum int4out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 298 of file int.c.
References palloc(), PG_GETARG_INT32, pg_ltoa(), and PG_RETURN_CSTRING.
Referenced by int4_to_char(), and jsonb_subscript_check_subscripts().
Datum int4pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 791 of file int.c.
References ereport, errcode(), errmsg(), ERROR, pg_add_s32_overflow(), PG_GETARG_INT32, PG_RETURN_INT32, and unlikely.
Datum int4recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 311 of file int.c.
References buf, PG_GETARG_POINTER, PG_RETURN_INT32, and pq_getmsgint().
Datum int4send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 322 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 771 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 | ) |
Definition at line 783 of file int.c.
References arg, PG_GETARG_INT32, and PG_RETURN_INT32.
Datum int4xor | ( | PG_FUNCTION_ARGS | ) |