|
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)) |
| Datum bool_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 401 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, fb(), Int2VectorSize, int2vector::lbound1, int2vector::ndim, palloc0(), SET_VARSIZE(), and int2vector::values.
Referenced by attnumstoint2vector(), CreateStatistics(), CreateTriggerFiringOn(), pg_get_publication_tables(), StorePartitionKey(), and UpdateIndexRelation().
|
static |
Definition at line 145 of file int.c.
References ereport, errcode(), errmsg(), ERROR, and fb().
Referenced by int2vectorout().
| Datum generate_series_int4 | ( | PG_FUNCTION_ARGS | ) |
| Datum generate_series_int4_support | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1614 of file int.c.
References DatumGetInt32(), estimate_expression_value(), fb(), is_funcclause(), IsA, linitial, list_length(), lsecond, lthird, PG_GETARG_POINTER, PG_RETURN_POINTER, and start.
| Datum generate_series_step_int4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1538 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), Int32GetDatum(), MemoryContextSwitchTo(), palloc_object, pg_add_s32_overflow(), PG_GETARG_INT32, PG_NARGS, SRF_FIRSTCALL_INIT, SRF_IS_FIRSTCALL, SRF_PERCALL_SETUP, SRF_RETURN_DONE, SRF_RETURN_NEXT, and start.
Referenced by generate_series_int4().
| Datum i2toi4 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 369 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_INT32.
| Datum i4toi2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 377 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT32, PG_RETURN_INT16, and unlikely.
| Datum in_range_int2_int2 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 768 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 733 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), 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 780 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 686 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 652 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), 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 698 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), 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 1059 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_INT32, PG_RETURN_NULL, and unlikely.
| Datum int24eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 533 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int24ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 578 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int24gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 569 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int24le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 560 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int24lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 551 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int24mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1031 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_INT32, pg_sub_s32_overflow(), and unlikely.
| Datum int24mul | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1045 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, PG_GETARG_INT32, pg_mul_s32_overflow(), PG_RETURN_INT32, and unlikely.
| Datum int24ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 542 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int24pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1017 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), pg_add_s32_overflow(), PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_INT32, and unlikely.
| Datum int2abs | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1234 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, PG_INT16_MIN, PG_RETURN_INT16, and unlikely.
| Datum int2and | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1475 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_INT16.
| Datum int2div | ( | PG_FUNCTION_ARGS | ) |
Definition at line 978 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, PG_INT16_MIN, PG_RETURN_INT16, PG_RETURN_NULL, and unlikely.
| Datum int2eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 479 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_BOOL.
| Datum int2ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 524 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_BOOL.
| Datum int2gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 515 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_BOOL.
| 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 | ) |
Definition at line 1375 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_INT16.
| Datum int2le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 506 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_BOOL.
| Datum int2lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 497 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_BOOL.
| Datum int2mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 949 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, PG_RETURN_INT16, pg_sub_s16_overflow(), and unlikely.
| Datum int2mod | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1187 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, PG_RETURN_INT16, PG_RETURN_NULL, and unlikely.
| Datum int2mul | ( | PG_FUNCTION_ARGS | ) |
Definition at line 963 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, pg_mul_s16_overflow(), PG_RETURN_INT16, and unlikely.
| Datum int2ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 488 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_BOOL.
| Datum int2not | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1502 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_INT16.
| Datum int2or | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1484 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_INT16.
| Datum int2out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 74 of file int.c.
References fb(), palloc(), PG_GETARG_INT16, pg_itoa(), and PG_RETURN_CSTRING.
| Datum int2pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 935 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), 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, fb(), PG_GETARG_INT16, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendint16().
Referenced by int2_bytea().
| Datum int2shl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1511 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_INT16.
| Datum int2shr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1520 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_INT16.
| Datum int2smaller | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1384 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_INT16.
| Datum int2um | ( | PG_FUNCTION_ARGS | ) |
Definition at line 915 of file int.c.
References arg, ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, PG_INT16_MIN, PG_RETURN_INT16, and unlikely.
| Datum int2up | ( | PG_FUNCTION_ARGS | ) |
Definition at line 927 of file int.c.
References arg, PG_GETARG_INT16, and PG_RETURN_INT16.
| Datum int2vectorin | ( | PG_FUNCTION_ARGS | ) |
Definition at line 165 of file int.c.
References int2vector::dataoffset, int2vector::dim1, int2vector::elemtype, ereturn, errcode(), errmsg(), fb(), 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 231 of file int.c.
References check_valid_int2vector(), fb(), palloc(), PG_GETARG_POINTER, pg_itoa(), and PG_RETURN_CSTRING.
| Datum int2vectorrecv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 259 of file int.c.
References ARR_ELEMTYPE, ARR_HASNULL, ARR_LBOUND, ARR_NDIM, array_recv(), Assert, buf, DatumGetPointer(), ereport, errcode(), errmsg(), ERROR, fb(), InitFunctionCallInfoData, Int32GetDatum(), InvalidOid, LOCAL_FCINFO, ObjectIdGetDatum(), PG_GETARG_POINTER, PG_RETURN_POINTER, and PointerGetDatum().
| Datum int2vectorsend | ( | PG_FUNCTION_ARGS | ) |
Definition at line 301 of file int.c.
References array_send().
| Datum int2xor | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1493 of file int.c.
References fb(), PG_GETARG_INT16, and PG_RETURN_INT16.
| Datum int42div | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1120 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), 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 587 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int42ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 632 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int42gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 623 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int42le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 614 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int42lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 605 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int42mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1092 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_INT32, pg_sub_s32_overflow(), and unlikely.
| Datum int42mul | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1106 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT16, PG_GETARG_INT32, pg_mul_s32_overflow(), PG_RETURN_INT32, and unlikely.
| Datum int42ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 596 of file int.c.
References fb(), PG_GETARG_INT16, PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int42pl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1078 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), pg_add_s32_overflow(), PG_GETARG_INT16, PG_GETARG_INT32, PG_RETURN_INT32, and unlikely.
| Datum int4_bool | ( | PG_FUNCTION_ARGS | ) |
Definition at line 391 of file int.c.
References PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int4abs | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1220 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT32, PG_INT32_MIN, PG_RETURN_INT32, and unlikely.
| Datum int4and | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1422 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_INT32.
| Datum int4div | ( | PG_FUNCTION_ARGS | ) |
Definition at line 862 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT32, PG_INT32_MIN, PG_RETURN_INT32, PG_RETURN_NULL, and unlikely.
| Datum int4eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 425 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int4gcd | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1323 of file int.c.
References fb(), int4gcd_internal(), PG_GETARG_INT32, and PG_RETURN_INT32.
Definition at line 1262 of file int.c.
References a1, a2, ereport, errcode(), errmsg(), ERROR, fb(), and PG_INT32_MIN.
| Datum int4ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 470 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int4gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 461 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int4in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 316 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 901 of file int.c.
References arg, ereport, errcode(), errmsg(), ERROR, fb(), pg_add_s32_overflow(), PG_GETARG_INT32, PG_RETURN_INT32, and unlikely.
| Datum int4larger | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1393 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_INT32.
| Datum int4lcm | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1338 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), gcd(), int4gcd_internal(), PG_GETARG_INT32, PG_INT32_MIN, pg_mul_s32_overflow(), PG_RETURN_INT32, and unlikely.
| Datum int4le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 452 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int4lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 443 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int4mi | ( | PG_FUNCTION_ARGS | ) |
Definition at line 834 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT32, PG_RETURN_INT32, pg_sub_s32_overflow(), and unlikely.
| Datum int4mod | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1159 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT32, PG_RETURN_INT32, PG_RETURN_NULL, and unlikely.
| Datum int4mul | ( | PG_FUNCTION_ARGS | ) |
Definition at line 848 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT32, pg_mul_s32_overflow(), PG_RETURN_INT32, and unlikely.
| Datum int4ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 434 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_BOOL.
| Datum int4not | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1467 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_INT32.
| Datum int4or | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1431 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_INT32.
| Datum int4out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 327 of file int.c.
References fb(), 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 820 of file int.c.
References ereport, errcode(), errmsg(), ERROR, fb(), pg_add_s32_overflow(), PG_GETARG_INT32, PG_RETURN_INT32, and unlikely.
| Datum int4recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 340 of file int.c.
References buf, PG_GETARG_POINTER, PG_RETURN_INT32, and pq_getmsgint().
| Datum int4send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 351 of file int.c.
References buf, fb(), PG_GETARG_INT32, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), and pq_sendint32().
Referenced by int4_bytea().
| Datum int4shl | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1449 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_INT32.
| Datum int4shr | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1458 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_INT32.
| Datum int4smaller | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1402 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_INT32.
| Datum int4um | ( | PG_FUNCTION_ARGS | ) |
Definition at line 800 of file int.c.
References arg, ereport, errcode(), errmsg(), ERROR, fb(), PG_GETARG_INT32, PG_INT32_MIN, PG_RETURN_INT32, and unlikely.
| Datum int4up | ( | PG_FUNCTION_ARGS | ) |
Definition at line 812 of file int.c.
References arg, PG_GETARG_INT32, and PG_RETURN_INT32.
| Datum int4xor | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1440 of file int.c.
References fb(), PG_GETARG_INT32, and PG_RETURN_INT32.