PostgreSQL Source Code git master
|
#include "postgres.h"
#include "access/genam.h"
#include "access/htup_details.h"
#include "access/table.h"
#include "catalog/pg_enum.h"
#include "libpq/pqformat.h"
#include "storage/procarray.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/syscache.h"
#include "utils/typcache.h"
Go to the source code of this file.
Functions | |
static Oid | enum_endpoint (Oid enumtypoid, ScanDirection direction) |
static ArrayType * | enum_range_internal (Oid enumtypoid, Oid lower, Oid upper) |
static void | check_safe_enum_use (HeapTuple enumval_tup) |
Datum | enum_in (PG_FUNCTION_ARGS) |
Datum | enum_out (PG_FUNCTION_ARGS) |
Datum | enum_recv (PG_FUNCTION_ARGS) |
Datum | enum_send (PG_FUNCTION_ARGS) |
static int | enum_cmp_internal (Oid arg1, Oid arg2, FunctionCallInfo fcinfo) |
Datum | enum_lt (PG_FUNCTION_ARGS) |
Datum | enum_le (PG_FUNCTION_ARGS) |
Datum | enum_eq (PG_FUNCTION_ARGS) |
Datum | enum_ne (PG_FUNCTION_ARGS) |
Datum | enum_ge (PG_FUNCTION_ARGS) |
Datum | enum_gt (PG_FUNCTION_ARGS) |
Datum | enum_smaller (PG_FUNCTION_ARGS) |
Datum | enum_larger (PG_FUNCTION_ARGS) |
Datum | enum_cmp (PG_FUNCTION_ARGS) |
Datum | enum_first (PG_FUNCTION_ARGS) |
Datum | enum_last (PG_FUNCTION_ARGS) |
Datum | enum_range_bounds (PG_FUNCTION_ARGS) |
Datum | enum_range_all (PG_FUNCTION_ARGS) |
|
static |
Definition at line 63 of file enum.c.
References EnumUncommitted(), ereport, errcode(), errhint(), errmsg(), ERROR, format_type_be(), GETSTRUCT(), HeapTupleHeaderGetXmin(), HeapTupleHeaderXminCommitted(), NameStr, HeapTupleData::t_data, TransactionIdDidCommit(), and TransactionIdIsInProgress().
Referenced by enum_endpoint(), enum_in(), enum_range_internal(), and enum_recv().
Datum enum_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 378 of file enum.c.
References a, b, enum_cmp_internal(), PG_GETARG_OID, and PG_RETURN_INT32.
Referenced by gbt_enumkey_cmp(), and gin_enum_cmp().
|
static |
Definition at line 252 of file enum.c.
References Assert(), compare_values_of_enum(), ereport, errcode(), errmsg(), ERROR, FunctionCallInfoBaseData::flinfo, FmgrInfo::fn_extra, GETSTRUCT(), HeapTupleIsValid, if(), lookup_type_cache(), ObjectIdGetDatum(), ReleaseSysCache(), and SearchSysCache1().
Referenced by enum_cmp(), enum_ge(), enum_gt(), enum_larger(), enum_le(), enum_lt(), and enum_smaller().
|
static |
Definition at line 392 of file enum.c.
References AccessShareLock, BTEqualStrategyNumber, check_safe_enum_use(), GETSTRUCT(), HeapTupleIsValid, index_close(), index_open(), InvalidOid, ObjectIdGetDatum(), ScanKeyInit(), systable_beginscan_ordered(), systable_endscan_ordered(), systable_getnext_ordered(), table_close(), and table_open().
Referenced by enum_first(), and enum_last().
Datum enum_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 324 of file enum.c.
References a, b, PG_GETARG_OID, and PG_RETURN_BOOL.
Datum enum_first | ( | PG_FUNCTION_ARGS | ) |
Definition at line 437 of file enum.c.
References enum_endpoint(), ereport, errcode(), errmsg(), ERROR, format_type_be(), ForwardScanDirection, get_fn_expr_argtype(), InvalidOid, OidIsValid, and PG_RETURN_OID.
Datum enum_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 342 of file enum.c.
References a, b, enum_cmp_internal(), PG_GETARG_OID, and PG_RETURN_BOOL.
Referenced by gbt_enumge().
Datum enum_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 351 of file enum.c.
References a, b, enum_cmp_internal(), PG_GETARG_OID, and PG_RETURN_BOOL.
Referenced by gbt_enumgt().
Datum enum_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 109 of file enum.c.
References check_safe_enum_use(), CStringGetDatum(), ereturn, errcode(), errmsg(), format_type_be(), GETSTRUCT(), HeapTupleIsValid, name, NAMEDATALEN, ObjectIdGetDatum(), PG_GETARG_CSTRING, PG_GETARG_OID, PG_RETURN_OID, ReleaseSysCache(), and SearchSysCache2().
Datum enum_larger | ( | PG_FUNCTION_ARGS | ) |
Definition at line 369 of file enum.c.
References a, b, enum_cmp_internal(), PG_GETARG_OID, and PG_RETURN_OID.
Datum enum_last | ( | PG_FUNCTION_ARGS | ) |
Definition at line 466 of file enum.c.
References BackwardScanDirection, enum_endpoint(), ereport, errcode(), errmsg(), ERROR, format_type_be(), get_fn_expr_argtype(), InvalidOid, OidIsValid, and PG_RETURN_OID.
Datum enum_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 315 of file enum.c.
References a, b, enum_cmp_internal(), PG_GETARG_OID, and PG_RETURN_BOOL.
Referenced by gbt_enumle().
Datum enum_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 306 of file enum.c.
References a, b, enum_cmp_internal(), PG_GETARG_OID, and PG_RETURN_BOOL.
Referenced by gbt_enumlt().
Datum enum_ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 333 of file enum.c.
References a, b, PG_GETARG_OID, and PG_RETURN_BOOL.
Datum enum_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 155 of file enum.c.
References ereport, errcode(), errmsg(), ERROR, GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_CSTRING, pstrdup(), ReleaseSysCache(), and SearchSysCache1().
Referenced by anyenum_out().
Datum enum_range_all | ( | PG_FUNCTION_ARGS | ) |
Definition at line 527 of file enum.c.
References enum_range_internal(), ereport, errcode(), errmsg(), ERROR, get_fn_expr_argtype(), InvalidOid, and PG_RETURN_ARRAYTYPE_P.
Datum enum_range_bounds | ( | PG_FUNCTION_ARGS | ) |
Definition at line 496 of file enum.c.
References enum_range_internal(), ereport, errcode(), errmsg(), ERROR, get_fn_expr_argtype(), InvalidOid, lower(), PG_ARGISNULL, PG_GETARG_OID, PG_RETURN_ARRAYTYPE_P, and upper().
Definition at line 547 of file enum.c.
References AccessShareLock, BTEqualStrategyNumber, check_safe_enum_use(), construct_array(), ForwardScanDirection, GETSTRUCT(), HeapTupleIsValid, index_close(), index_open(), lower(), ObjectIdGetDatum(), OidIsValid, palloc(), pfree(), repalloc(), ScanKeyInit(), systable_beginscan_ordered(), systable_endscan_ordered(), systable_getnext_ordered(), table_close(), table_open(), and upper().
Referenced by enum_range_all(), and enum_range_bounds().
Datum enum_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 179 of file enum.c.
References buf, check_safe_enum_use(), CStringGetDatum(), ereport, errcode(), errmsg(), ERROR, format_type_be(), GETSTRUCT(), HeapTupleIsValid, name, NAMEDATALEN, ObjectIdGetDatum(), pfree(), PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_OID, pq_getmsgtext(), ReleaseSysCache(), and SearchSysCache2().
Datum enum_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 221 of file enum.c.
References buf, ereport, errcode(), errmsg(), ERROR, GETSTRUCT(), HeapTupleIsValid, NameStr, ObjectIdGetDatum(), PG_GETARG_OID, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendtext(), ReleaseSysCache(), and SearchSysCache1().
Datum enum_smaller | ( | PG_FUNCTION_ARGS | ) |
Definition at line 360 of file enum.c.
References a, b, enum_cmp_internal(), PG_GETARG_OID, and PG_RETURN_OID.