24 #include "utils/fmgroids.h"
98 (
errcode(ERRCODE_UNSAFE_NEW_ENUM_VALUE_USAGE),
99 errmsg(
"unsafe use of new value \"%s\" of enum type %s",
102 errhint(
"New enum values must be committed before they can be used.")));
113 Node *escontext = fcinfo->context;
120 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
121 errmsg(
"invalid input value for enum %s: \"%s\"",
130 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
131 errmsg(
"invalid input value for enum %s: \"%s\"",
165 (
errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
166 errmsg(
"invalid internal value for enum: %u",
193 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
194 errmsg(
"invalid input value for enum %s: \"%s\"",
203 (
errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
204 errmsg(
"invalid input value for enum %s: \"%s\"",
231 (
errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
232 errmsg(
"invalid internal value for enum: %u",
270 if ((arg1 & 1) == 0 && (arg2 & 1) == 0)
290 (
errcode(ERRCODE_INVALID_BINARY_REPRESENTATION),
291 errmsg(
"invalid internal value for enum: %u",
294 typeoid = en->enumtypid;
407 Anum_pg_enum_enumtypid,
450 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
451 errmsg(
"could not determine actual enum type")));
458 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
459 errmsg(
"enum %s contains no values",
479 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
480 errmsg(
"could not determine actual enum type")));
487 (
errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
488 errmsg(
"enum %s contains no values",
519 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
520 errmsg(
"could not determine actual enum type")));
539 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
540 errmsg(
"could not determine actual enum type")));
566 Anum_pg_enum_enumtypid,
583 if (!left_found &&
lower == enum_oid)
611 sizeof(
Oid),
true, TYPALIGN_INT);
#define PG_RETURN_ARRAYTYPE_P(x)
ArrayType * construct_array(Datum *elems, int nelems, Oid elmtype, int elmlen, bool elmbyval, char elmalign)
#define Assert(condition)
#define OidIsValid(objectId)
int errhint(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereturn(context, dummy_value,...)
#define ereport(elevel,...)
Datum enum_range_all(PG_FUNCTION_ARGS)
Datum enum_last(PG_FUNCTION_ARGS)
static void check_safe_enum_use(HeapTuple enumval_tup)
Datum enum_gt(PG_FUNCTION_ARGS)
Datum enum_first(PG_FUNCTION_ARGS)
static Oid enum_endpoint(Oid enumtypoid, ScanDirection direction)
Datum enum_smaller(PG_FUNCTION_ARGS)
Datum enum_lt(PG_FUNCTION_ARGS)
Datum enum_cmp(PG_FUNCTION_ARGS)
Datum enum_eq(PG_FUNCTION_ARGS)
Datum enum_range_bounds(PG_FUNCTION_ARGS)
Datum enum_send(PG_FUNCTION_ARGS)
static ArrayType * enum_range_internal(Oid enumtypoid, Oid lower, Oid upper)
Datum enum_ge(PG_FUNCTION_ARGS)
Datum enum_in(PG_FUNCTION_ARGS)
Datum enum_recv(PG_FUNCTION_ARGS)
static int enum_cmp_internal(Oid arg1, Oid arg2, FunctionCallInfo fcinfo)
Datum enum_out(PG_FUNCTION_ARGS)
Datum enum_larger(PG_FUNCTION_ARGS)
Datum enum_le(PG_FUNCTION_ARGS)
Datum enum_ne(PG_FUNCTION_ARGS)
Oid get_fn_expr_argtype(FmgrInfo *flinfo, int argnum)
#define PG_RETURN_BYTEA_P(x)
#define PG_GETARG_POINTER(n)
#define PG_RETURN_CSTRING(x)
#define PG_GETARG_CSTRING(n)
#define PG_RETURN_INT32(x)
#define PG_RETURN_BOOL(x)
SysScanDesc systable_beginscan_ordered(Relation heapRelation, Relation indexRelation, Snapshot snapshot, int nkeys, ScanKey key)
void systable_endscan_ordered(SysScanDesc sysscan)
HeapTuple systable_getnext_ordered(SysScanDesc sysscan, ScanDirection direction)
#define HeapTupleIsValid(tuple)
#define HeapTupleHeaderGetXmin(tup)
#define HeapTupleHeaderXminCommitted(tup)
void index_close(Relation relation, LOCKMODE lockmode)
Relation index_open(Oid relationId, LOCKMODE lockmode)
if(TABLE==NULL||TABLE_index==NULL)
char * pstrdup(const char *in)
void pfree(void *pointer)
void * repalloc(void *pointer, Size size)
Datum lower(PG_FUNCTION_ARGS)
Datum upper(PG_FUNCTION_ARGS)
bool EnumUncommitted(Oid enum_id)
FormData_pg_enum * Form_pg_enum
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
bool TransactionIdIsInProgress(TransactionId xid)
void ScanKeyInit(ScanKey entry, AttrNumber attributeNumber, StrategyNumber strategy, RegProcedure procedure, Datum argument)
#define BTEqualStrategyNumber
StringInfoData * StringInfo
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
HeapTuple SearchSysCache2(int cacheId, Datum key1, Datum key2)
void table_close(Relation relation, LOCKMODE lockmode)
Relation table_open(Oid relationId, LOCKMODE lockmode)
bool TransactionIdDidCommit(TransactionId transactionId)
int compare_values_of_enum(TypeCacheEntry *tcache, Oid arg1, Oid arg2)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)