39 int32 *typmod_p,
bool missing_ok)
42 typeName, typmod_p,
true, missing_ok);
75 bool temp_ok,
bool missing_ok)
100 errmsg(
"improper %%TYPE reference (too few dotted names): %s",
121 (
errcode(ERRCODE_SYNTAX_ERROR),
122 errmsg(
"improper %%TYPE reference (too many dotted names): %s",
143 (
errcode(ERRCODE_UNDEFINED_COLUMN),
144 errmsg(
"column \"%s\" of relation \"%s\" does not exist",
157 (
errmsg(
"type reference %s converted to %s",
209 elog(
ERROR,
"cache lookup failed for type %u", typoid);
242 (
errcode(ERRCODE_UNDEFINED_OBJECT),
243 errmsg(
"type \"%s\" does not exist",
271 (
errcode(ERRCODE_UNDEFINED_OBJECT),
272 errmsg(
"type \"%s\" does not exist",
277 (
errcode(ERRCODE_UNDEFINED_OBJECT),
278 errmsg(
"type \"%s\" is only a shell",
353 (
errcode(ERRCODE_SYNTAX_ERROR),
354 errmsg(
"type modifier cannot be specified for shell type \"%s\"",
362 (
errcode(ERRCODE_SYNTAX_ERROR),
363 errmsg(
"type modifier is not allowed for type \"%s\"",
408 (
errcode(ERRCODE_SYNTAX_ERROR),
409 errmsg(
"type modifiers must be simple constants or identifiers"),
446 foreach(l, typeName->
names)
561 result = typcollation;
567 (
errcode(ERRCODE_DATATYPE_MISMATCH),
568 errmsg(
"collations are not supported by type %s",
584 elog(
ERROR,
"cache lookup failed for type %u",
id);
593 elog(
ERROR,
"typeTypeId() called with NULL type struct");
614 return typ->typbyval;
635 return typtup->typrelid;
645 return typtup->typcollation;
657 Oid typinput = typform->typinput;
676 elog(
ERROR,
"cache lookup failed for type %u", type_id);
678 result =
type->typrelid;
699 elog(
ERROR,
"cache lookup failed for type %u", type_id);
701 if (
type->typtype != TYPTYPE_DOMAIN)
707 type_id =
type->typbasetype;
710 result =
type->typrelid;
721 const char *
str = (
const char *)
arg;
740 List *raw_parsetree_list;
745 if (strspn(
str,
" \t\n\r\f\v") == strlen(
str))
772 (
errcode(ERRCODE_SYNTAX_ERROR),
773 errmsg(
"invalid type name \"%s\"",
str)));
792 if (typeName == NULL)
800 (
errcode(ERRCODE_UNDEFINED_OBJECT),
801 errmsg(
"type \"%s\" does not exist",
808 if (!typ->typisdefined)
812 (
errcode(ERRCODE_UNDEFINED_OBJECT),
813 errmsg(
"type \"%s\" is only a shell",
816 *typeid_p = typ->oid;
ArrayType * construct_array_builtin(Datum *elems, int nelems, Oid elmtype)
#define InvalidAttrNumber
List * raw_parser(const char *str, RawParseMode mode)
#define unconstify(underlying_type, expr)
#define Assert(condition)
#define OidIsValid(objectId)
ErrorContextCallback * error_context_stack
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereturn(context, dummy_value,...)
#define ereport(elevel,...)
Datum OidInputFunctionCall(Oid functionId, char *str, Oid typioparam, int32 typmod)
#define OidFunctionCall1(functionId, arg1)
#define HeapTupleIsValid(tuple)
AttrNumber get_attnum(Oid relid, const char *attname)
Oid get_typcollation(Oid typid)
Oid getTypeIOParam(HeapTuple typeTuple)
Oid get_array_type(Oid typid)
Oid get_atttype(Oid relid, AttrNumber attnum)
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
char * pstrdup(const char *in)
void pfree(void *pointer)
Oid LookupExplicitNamespace(const char *nspname, bool missing_ok)
Oid get_collation_oid(List *collname, bool missing_ok)
void DeconstructQualifiedName(const List *names, char **nspname_p, char **objname_p)
Oid TypenameGetTypidExtended(const char *typname, bool temp_ok)
char * NameListToString(const List *names)
#define RangeVarGetRelid(relation, lockmode, missing_ok)
#define IsA(nodeptr, _type_)
void cancel_parser_errposition_callback(ParseCallbackState *pcbstate)
int parser_errposition(ParseState *pstate, int location)
void setup_parser_errposition_callback(ParseCallbackState *pcbstate, ParseState *pstate, int location)
static void appendTypeNameToBuffer(const TypeName *typeName, StringInfo string)
Oid typeTypeRelid(Type typ)
Oid typeOrDomainTypeRelid(Oid type_id)
Oid LookupCollation(ParseState *pstate, List *collnames, int location)
Type LookupTypeNameExtended(ParseState *pstate, const TypeName *typeName, int32 *typmod_p, bool temp_ok, bool missing_ok)
Oid typeTypeCollation(Type typ)
void typenameTypeIdAndMod(ParseState *pstate, const TypeName *typeName, Oid *typeid_p, int32 *typmod_p)
char * TypeNameListToString(List *typenames)
bool parseTypeString(const char *str, Oid *typeid_p, int32 *typmod_p, Node *escontext)
Type LookupTypeName(ParseState *pstate, const TypeName *typeName, int32 *typmod_p, bool missing_ok)
Oid typeidTypeRelid(Oid type_id)
static void pts_error_callback(void *arg)
char * TypeNameToString(const TypeName *typeName)
Datum stringTypeDatum(Type tp, char *string, int32 atttypmod)
Type typenameType(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
TypeName * typeStringToTypeName(const char *str, Node *escontext)
static int32 typenameTypeMod(ParseState *pstate, const TypeName *typeName, Type typ)
Oid GetColumnDefCollation(ParseState *pstate, const ColumnDef *coldef, Oid typeOid)
Oid typenameTypeId(ParseState *pstate, const TypeName *typeName)
Oid LookupTypeNameOid(ParseState *pstate, const TypeName *typeName, bool missing_ok)
char * typeTypeName(Type t)
#define lfirst_node(type, lc)
static int list_length(const List *l)
#define linitial_node(type, l)
static ListCell * list_head(const List *l)
FormData_pg_type * Form_pg_type
static Datum PointerGetDatum(const void *X)
static Datum ObjectIdGetDatum(Oid X)
static Datum CStringGetDatum(const char *X)
static int32 DatumGetInt32(Datum X)
char * psprintf(const char *fmt,...)
void appendStringInfoString(StringInfo str, const char *s)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
CollateClause * collClause
struct ErrorContextCallback * previous
void(* callback)(void *arg)
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define GetSysCacheOid2(cacheId, oidcol, key1, key2)