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\"",
383 if (
IsA(&ac->
val, Integer))
387 else if (
IsA(&ac->
val, Float) ||
404 (
errcode(ERRCODE_SYNTAX_ERROR),
405 errmsg(
"type modifiers must be simple constants or identifiers"),
412 -2,
false, TYPALIGN_CHAR);
444 foreach(l, typeName->
names)
496 foreach(l, typenames)
559 result = typcollation;
565 (
errcode(ERRCODE_DATATYPE_MISMATCH),
566 errmsg(
"collations are not supported by type %s",
582 elog(
ERROR,
"cache lookup failed for type %u",
id);
591 elog(
ERROR,
"typeTypeId() called with NULL type struct");
612 return typ->typbyval;
633 return typtup->typrelid;
643 return typtup->typcollation;
655 Oid typinput = typform->typinput;
674 elog(
ERROR,
"cache lookup failed for type %u", type_id);
676 result = type->typrelid;
697 elog(
ERROR,
"cache lookup failed for type %u", type_id);
699 if (type->typtype != TYPTYPE_DOMAIN)
705 type_id = type->typbasetype;
708 result = type->typrelid;
719 const char *
str = (
const char *) arg;
733 List *raw_parsetree_list;
738 if (strspn(str,
" \t\n\r\f") == strlen(str))
765 (
errcode(ERRCODE_SYNTAX_ERROR),
766 errmsg(
"invalid type name \"%s\"", str)));
790 (
errcode(ERRCODE_UNDEFINED_OBJECT),
791 errmsg(
"type \"%s\" does not exist",
800 if (!typ->typisdefined)
802 (
errcode(ERRCODE_UNDEFINED_OBJECT),
803 errmsg(
"type \"%s\" is only a shell",
806 *typeid_p = typ->oid;
Type LookupTypeName(ParseState *pstate, const TypeName *typeName, int32 *typmod_p, bool missing_ok)
Type LookupTypeNameExtended(ParseState *pstate, const TypeName *typeName, int32 *typmod_p, bool temp_ok, bool missing_ok)
Oid typeTypeCollation(Type typ)
#define IsA(nodeptr, _type_)
Oid LookupExplicitNamespace(const char *nspname, bool missing_ok)
Oid typeOrDomainTypeRelid(Oid type_id)
Type typenameType(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
#define PointerGetDatum(X)
#define RangeVarGetRelid(relation, lockmode, missing_ok)
char * TypeNameToString(const TypeName *typeName)
Oid get_array_type(Oid typid)
char * pstrdup(const char *in)
char * psprintf(const char *fmt,...)
ArrayType * construct_array(Datum *elems, int nelems, Oid elmtype, int elmlen, bool elmbyval, char elmalign)
int errcode(int sqlerrcode)
char * TypeNameListToString(List *typenames)
Oid typeidTypeRelid(Oid type_id)
void DeconstructQualifiedName(List *names, char **nspname_p, char **objname_p)
#define linitial_node(type, l)
void(* callback)(void *arg)
struct ErrorContextCallback * previous
#define OidIsValid(objectId)
Oid TypenameGetTypidExtended(const char *typname, bool temp_ok)
ErrorContextCallback * error_context_stack
void pfree(void *pointer)
void cancel_parser_errposition_callback(ParseCallbackState *pcbstate)
#define ObjectIdGetDatum(X)
char * typeTypeName(Type t)
#define OidFunctionCall1(functionId, arg1)
Datum stringTypeDatum(Type tp, char *string, int32 atttypmod)
#define lfirst_node(type, lc)
void appendStringInfoString(StringInfo str, const char *s)
static void pts_error_callback(void *arg)
AttrNumber get_attnum(Oid relid, const char *attname)
union Value::ValUnion val
#define CStringGetDatum(X)
static ListCell * list_head(const List *l)
static void appendTypeNameToBuffer(const TypeName *typeName, StringInfo string)
Oid get_atttype(Oid relid, AttrNumber attnum)
void setup_parser_errposition_callback(ParseCallbackState *pcbstate, ParseState *pstate, int location)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
#define unconstify(underlying_type, expr)
Oid GetColumnDefCollation(ParseState *pstate, ColumnDef *coldef, Oid typeOid)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
char * NameListToString(List *names)
void ReleaseSysCache(HeapTuple tuple)
TypeName * typeStringToTypeName(const char *str)
void typenameTypeIdAndMod(ParseState *pstate, const TypeName *typeName, Oid *typeid_p, int32 *typmod_p)
Oid LookupCollation(ParseState *pstate, List *collnames, int location)
void parseTypeString(const char *str, Oid *typeid_p, int32 *typmod_p, bool missing_ok)
#define ereport(elevel,...)
Oid get_typcollation(Oid typid)
#define HeapTupleIsValid(tuple)
#define Assert(condition)
#define GetSysCacheOid2(cacheId, oidcol, key1, key2)
FormData_pg_type * Form_pg_type
static int list_length(const List *l)
int parser_errposition(ParseState *pstate, int location)
CollateClause * collClause
#define InvalidAttrNumber
int errmsg(const char *fmt,...)
Oid typeTypeRelid(Type typ)
Oid getTypeIOParam(HeapTuple typeTuple)
List * raw_parser(const char *str, RawParseMode mode)
Oid get_collation_oid(List *name, bool missing_ok)
Datum OidInputFunctionCall(Oid functionId, char *str, Oid typioparam, int32 typmod)
RangeVar * makeRangeVar(char *schemaname, char *relname, int location)
static int32 typenameTypeMod(ParseState *pstate, const TypeName *typeName, Type typ)
Oid LookupTypeNameOid(ParseState *pstate, const TypeName *typeName, bool missing_ok)
Oid typenameTypeId(ParseState *pstate, const TypeName *typeName)