92 if (typentry->
typtype != TYPTYPE_DOMAIN)
94 (
errcode(ERRCODE_DATATYPE_MISMATCH),
95 errmsg(
"type %s is not a domain",
118 my_extra->
mcxt = mcxt;
157 (
errcode(ERRCODE_NOT_NULL_VIOLATION),
158 errmsg(
"domain %s does not allow null values",
167 if (econtext == NULL)
195 (
errcode(ERRCODE_CHECK_VIOLATION),
196 errmsg(
"value for domain %s violates check constraint \"%s\"",
206 elog(
ERROR,
"unrecognized constraint type: %d",
231 Node *escontext = fcinfo->context;
257 fcinfo->flinfo->fn_mcxt);
258 fcinfo->flinfo->fn_extra = my_extra;
316 fcinfo->flinfo->fn_mcxt);
317 fcinfo->flinfo->fn_extra = my_extra;
387 if (my_extra == NULL || my_extra->
domain_type != domainType)
414 elog(
ERROR,
"cache lookup failed for type %u", datatypeOid);
static bool domain_check_internal(Datum value, bool isnull, Oid domainType, void **extra, MemoryContext mcxt, Node *escontext)
struct DomainIOData DomainIOData
int errdatatype(Oid datatypeOid)
Datum domain_recv(PG_FUNCTION_ARGS)
int errdomainconstraint(Oid datatypeOid, const char *conname)
Datum domain_in(PG_FUNCTION_ARGS)
void domain_check(Datum value, bool isnull, Oid domainType, void **extra, MemoryContext mcxt)
static void domain_check_input(Datum value, bool isnull, DomainIOData *my_extra, Node *escontext)
bool domain_check_safe(Datum value, bool isnull, Oid domainType, void **extra, MemoryContext mcxt, Node *escontext)
static DomainIOData * domain_state_setup(Oid domainType, bool binary, MemoryContext mcxt)
int err_generic_string(int field, const char *str)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define errsave(context,...)
#define ereport(elevel,...)
bool ExecCheck(ExprState *state, ExprContext *econtext)
void ReScanExprContext(ExprContext *econtext)
ExprContext * CreateStandaloneExprContext(void)
#define MakeExpandedObjectReadOnly(d, isnull, typlen)
void fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt)
bool InputFunctionCallSafe(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod, fmNodePtr escontext, Datum *result)
Datum ReceiveFunctionCall(FmgrInfo *flinfo, StringInfo buf, Oid typioparam, int32 typmod)
#define PG_GETARG_POINTER(n)
#define PG_GETARG_CSTRING(n)
#define PG_RETURN_DATUM(x)
#define HeapTupleIsValid(tuple)
if(TABLE==NULL||TABLE_index==NULL)
char * get_namespace_name(Oid nspid)
void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam)
void getTypeBinaryInputInfo(Oid type, Oid *typReceive, Oid *typIOParam)
MemoryContext CurrentMemoryContext
void * MemoryContextAlloc(MemoryContext context, Size size)
#define SOFT_ERROR_OCCURRED(escontext)
FormData_pg_type * Form_pg_type
static Datum ObjectIdGetDatum(Oid X)
#define PG_DIAG_SCHEMA_NAME
#define PG_DIAG_CONSTRAINT_NAME
#define PG_DIAG_DATATYPE_NAME
MemoryContextSwitchTo(old_ctx)
StringInfoData * StringInfo
DomainConstraintType constrainttype
ExprState * check_exprstate
DomainConstraintRef constraint_ref
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
void InitDomainConstraintRef(Oid type_id, DomainConstraintRef *ref, MemoryContext refctx, bool need_exprstate)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)
void UpdateDomainConstraintRef(DomainConstraintRef *ref)
#define TYPECACHE_DOMAIN_BASE_INFO