58 int32 *typmod_p,
bool missing_ok)
83 errmsg(
"improper %%TYPE reference (too few dotted names): %s",
104 (
errcode(ERRCODE_SYNTAX_ERROR),
105 errmsg(
"improper %%TYPE reference (too many dotted names): %s",
126 (
errcode(ERRCODE_UNDEFINED_COLUMN),
127 errmsg(
"column \"%s\" of relation \"%s\" does not exist",
140 (
errmsg(
"type reference %s converted to %s",
192 elog(
ERROR,
"cache lookup failed for type %u", typoid);
225 (
errcode(ERRCODE_UNDEFINED_OBJECT),
226 errmsg(
"type \"%s\" does not exist",
254 (
errcode(ERRCODE_UNDEFINED_OBJECT),
255 errmsg(
"type \"%s\" does not exist",
260 (
errcode(ERRCODE_UNDEFINED_OBJECT),
261 errmsg(
"type \"%s\" is only a shell",
336 (
errcode(ERRCODE_SYNTAX_ERROR),
337 errmsg(
"type modifier cannot be specified for shell type \"%s\"",
345 (
errcode(ERRCODE_SYNTAX_ERROR),
346 errmsg(
"type modifier is not allowed for type \"%s\"",
366 if (
IsA(&ac->
val, Integer))
370 else if (
IsA(&ac->
val, Float) ||
387 (
errcode(ERRCODE_SYNTAX_ERROR),
388 errmsg(
"type modifiers must be simple constants or identifiers"),
427 foreach(l, typeName->
names)
479 foreach(l, typenames)
543 result = typcollation;
549 (
errcode(ERRCODE_DATATYPE_MISMATCH),
550 errmsg(
"collations are not supported by type %s",
566 elog(
ERROR,
"cache lookup failed for type %u",
id);
575 elog(
ERROR,
"typeTypeId() called with NULL type struct");
596 return typ->typbyval;
617 return typtup->typrelid;
627 return typtup->typcollation;
639 Oid typinput = typform->typinput;
655 elog(
ERROR,
"cache lookup failed for type %u", type_id);
658 result = type->typrelid;
669 const char *str = (
const char *) arg;
691 List *raw_parsetree_list;
699 if (strspn(str,
" \t\n\r\f") == strlen(str))
709 ptserrcontext.
arg = (
void *) str;
744 if (restarget ==
NULL ||
750 if (typecast ==
NULL ||
757 if (typeName ==
NULL ||
769 (
errcode(ERRCODE_SYNTAX_ERROR),
770 errmsg(
"invalid type name \"%s\"", str)));
794 (
errcode(ERRCODE_UNDEFINED_OBJECT),
795 errmsg(
"type \"%s\" does not exist",
804 (
errcode(ERRCODE_UNDEFINED_OBJECT),
805 errmsg(
"type \"%s\" is only a shell",
Type LookupTypeName(ParseState *pstate, const TypeName *typeName, int32 *typmod_p, bool missing_ok)
Oid typeTypeCollation(Type typ)
#define IsA(nodeptr, _type_)
Oid LookupExplicitNamespace(const char *nspname, bool missing_ok)
List * raw_parser(const char *str)
Type typenameType(ParseState *pstate, const TypeName *typeName, int32 *typmod_p)
Oid TypenameGetTypid(const char *typname)
#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)
FormData_pg_type * Form_pg_type
struct ErrorContextCallback * previous
#define OidIsValid(objectId)
#define SearchSysCache1(cacheId, key1)
#define GetSysCacheOid2(cacheId, key1, key2)
ErrorContextCallback * error_context_stack
void pfree(void *pointer)
void cancel_parser_errposition_callback(ParseCallbackState *pcbstate)
void appendStringInfo(StringInfo str, const char *fmt,...)
#define ObjectIdGetDatum(X)
char * typeTypeName(Type t)
#define OidFunctionCall1(functionId, arg1)
Datum stringTypeDatum(Type tp, char *string, int32 atttypmod)
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)
#define ereport(elevel, rest)
void setup_parser_errposition_callback(ParseCallbackState *pcbstate, ParseState *pstate, int location)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
Oid GetColumnDefCollation(ParseState *pstate, ColumnDef *coldef, Oid typeOid)
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)
Oid get_typcollation(Oid typid)
#define HeapTupleIsValid(tuple)
#define Assert(condition)
static int list_length(const List *l)
int parser_errposition(ParseState *pstate, int location)
CollateClause * collClause
#define InvalidAttrNumber
void(* callback)(void *arg)
int errmsg(const char *fmt,...)
Oid typeTypeRelid(Type typ)
Oid getTypeIOParam(HeapTuple typeTuple)
#define HeapTupleGetOid(tuple)
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)
int errposition(int cursorpos)
Oid LookupTypeNameOid(ParseState *pstate, const TypeName *typeName, bool missing_ok)
Oid typenameTypeId(ParseState *pstate, const TypeName *typeName)