PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/htup_details.h"
#include "catalog/pg_type.h"
#include "executor/executor.h"
#include "lib/stringinfo.h"
#include "utils/builtins.h"
#include "utils/expandeddatum.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
#include "utils/typcache.h"
Go to the source code of this file.
Data Structures | |
struct | DomainIOData |
Typedefs | |
typedef struct DomainIOData | DomainIOData |
Functions | |
static bool | domain_check_internal (Datum value, bool isnull, Oid domainType, void **extra, MemoryContext mcxt, Node *escontext) |
static DomainIOData * | domain_state_setup (Oid domainType, bool binary, MemoryContext mcxt) |
static void | domain_check_input (Datum value, bool isnull, DomainIOData *my_extra, Node *escontext) |
Datum | domain_in (PG_FUNCTION_ARGS) |
Datum | domain_recv (PG_FUNCTION_ARGS) |
void | domain_check (Datum value, bool isnull, Oid domainType, void **extra, MemoryContext mcxt) |
bool | domain_check_safe (Datum value, bool isnull, Oid domainType, void **extra, MemoryContext mcxt, Node *escontext) |
int | errdatatype (Oid datatypeOid) |
int | errdomainconstraint (Oid datatypeOid, const char *conname) |
typedef struct DomainIOData DomainIOData |
void domain_check | ( | Datum | value, |
bool | isnull, | ||
Oid | domainType, | ||
void ** | extra, | ||
MemoryContext | mcxt | ||
) |
Definition at line 346 of file domains.c.
References domain_check_internal(), and value.
Referenced by check_domain_for_new_field(), check_domain_for_new_tuple(), expanded_record_set_fields(), hstore_populate_record(), plperl_return_next_internal(), plperl_sv_to_datum(), plpgsql_exec_function(), pltcl_build_tuple_result(), and PLyObject_ToDomain().
|
static |
Definition at line 138 of file domains.c.
References DomainConstraintState::check_exprstate, DomainIOData::constraint_ref, DomainConstraintRef::constraints, DomainConstraintState::constrainttype, CreateStandaloneExprContext(), DOM_CONSTRAINT_CHECK, DOM_CONSTRAINT_NOTNULL, DomainIOData::domain_type, ExprContext::domainValue_datum, ExprContext::domainValue_isNull, DomainIOData::econtext, elog, errcode(), errdatatype(), errdomainconstraint(), errmsg(), ERROR, errsave, ExecCheck(), format_type_be(), lfirst, MakeExpandedObjectReadOnly, DomainIOData::mcxt, MemoryContextSwitchTo(), DomainConstraintState::name, ReScanExprContext(), DomainConstraintRef::tcache, TypeCacheEntry::typlen, UpdateDomainConstraintRef(), and value.
Referenced by domain_check_internal(), domain_in(), and domain_recv().
|
static |
Definition at line 371 of file domains.c.
References CurrentMemoryContext, domain_check_input(), domain_state_setup(), DomainIOData::domain_type, SOFT_ERROR_OCCURRED, and value.
Referenced by domain_check(), and domain_check_safe().
bool domain_check_safe | ( | Datum | value, |
bool | isnull, | ||
Oid | domainType, | ||
void ** | extra, | ||
MemoryContext | mcxt, | ||
Node * | escontext | ||
) |
Definition at line 355 of file domains.c.
References domain_check_internal(), and value.
Referenced by ExecEvalJsonCoercion(), populate_composite(), populate_domain(), and populate_recordset_record().
Datum domain_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 227 of file domains.c.
References domain_check_input(), domain_state_setup(), DomainIOData::domain_type, if(), InputFunctionCallSafe(), PG_ARGISNULL, PG_GETARG_CSTRING, PG_GETARG_OID, PG_RETURN_DATUM, PG_RETURN_NULL, DomainIOData::proc, DomainIOData::typioparam, DomainIOData::typtypmod, and value.
Datum domain_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 287 of file domains.c.
References buf, domain_check_input(), domain_state_setup(), DomainIOData::domain_type, if(), PG_ARGISNULL, PG_GETARG_OID, PG_GETARG_POINTER, PG_RETURN_DATUM, PG_RETURN_NULL, DomainIOData::proc, ReceiveFunctionCall(), DomainIOData::typioparam, DomainIOData::typtypmod, and value.
|
static |
Definition at line 76 of file domains.c.
References DomainIOData::constraint_ref, DomainIOData::domain_type, TypeCacheEntry::domainBaseType, TypeCacheEntry::domainBaseTypmod, DomainIOData::econtext, ereport, errcode(), errmsg(), ERROR, fmgr_info_cxt(), format_type_be(), getTypeBinaryInputInfo(), getTypeInputInfo(), InitDomainConstraintRef(), lookup_type_cache(), DomainIOData::mcxt, MemoryContextAlloc(), DomainIOData::proc, TYPECACHE_DOMAIN_BASE_INFO, DomainIOData::typiofunc, DomainIOData::typioparam, TypeCacheEntry::typtype, and DomainIOData::typtypmod.
Referenced by domain_check_internal(), domain_in(), and domain_recv().
int errdatatype | ( | Oid | datatypeOid | ) |
Definition at line 407 of file domains.c.
References elog, err_generic_string(), ERROR, get_namespace_name(), GETSTRUCT, HeapTupleIsValid, NameStr, ObjectIdGetDatum(), PG_DIAG_DATATYPE_NAME, PG_DIAG_SCHEMA_NAME, ReleaseSysCache(), and SearchSysCache1().
Referenced by domain_check_input(), errdomainconstraint(), and ExecEvalConstraintNotNull().
int errdomainconstraint | ( | Oid | datatypeOid, |
const char * | conname | ||
) |
Definition at line 431 of file domains.c.
References err_generic_string(), errdatatype(), and PG_DIAG_CONSTRAINT_NAME.
Referenced by domain_check_input(), and ExecEvalConstraintCheck().