25 #include "utils/fmgroids.h" 137 elog(
ERROR,
"cache lookup failed for type %u", type_oid);
147 array_base_type = typeform->typelem;
149 if (IsTrueArrayType(typeform) &&
150 typeform->typstorage != TYPSTORAGE_PLAIN)
162 elog(
ERROR,
"cache lookup failed for type %u", type_oid);
165 type_oid = array_base_type;
190 buf =
printTypmod(
"bit", typemod, typeform->typmodout);
209 buf =
printTypmod(
"character", typemod, typeform->typmodout);
210 else if ((flags & FORMAT_TYPE_TYPEMOD_GIVEN) != 0)
227 buf =
pstrdup(
"double precision");
244 buf =
printTypmod(
"numeric", typemod, typeform->typmodout);
251 buf =
printTypmod(
"interval", typemod, typeform->typmodout);
258 buf =
printTypmod(
"time", typemod, typeform->typmodout);
260 buf =
pstrdup(
"time without time zone");
265 buf =
printTypmod(
"time", typemod, typeform->typmodout);
267 buf =
pstrdup(
"time with time zone");
272 buf =
printTypmod(
"timestamp", typemod, typeform->typmodout);
274 buf =
pstrdup(
"timestamp without time zone");
279 buf =
printTypmod(
"timestamp", typemod, typeform->typmodout);
281 buf =
pstrdup(
"timestamp with time zone");
286 buf =
printTypmod(
"bit varying", typemod, typeform->typmodout);
293 buf =
printTypmod(
"character varying", typemod, typeform->typmodout);
295 buf =
pstrdup(
"character varying");
316 typname =
NameStr(typeform->typname);
321 buf =
printTypmod(buf, typemod, typeform->typmodout);
377 res =
psprintf(
"%s(%d)", typname, (
int) typmod);
386 res =
psprintf(
"%s%s", typname, tmstr);
447 int numargs = oidArray->
dim1;
452 total = 20 * numargs + 1;
457 for (num = 0; num < numargs; num++)
461 size_t slen = strlen(
typename);
463 if (left < (slen + 2))
472 strcat(result,
", ");
475 strcat(result,
typename);
#define PG_GETARG_INT32(n)
char * pstrdup(const char *in)
#define FORMAT_TYPE_TYPEMOD_GIVEN
char * psprintf(const char *fmt,...)
#define PG_GETARG_POINTER(n)
#define ObjectIdGetDatum(X)
#define DatumGetCString(X)
#define OidFunctionCall1(functionId, arg1)
int pg_encoding_max_length(int encoding)
Oid values[FLEXIBLE_ARRAY_MEMBER]
#define FORMAT_TYPE_FORCE_QUALIFY
char * quote_qualified_identifier(const char *qualifier, const char *ident)
HeapTuple SearchSysCache1(int cacheId, Datum key1)
#define FORMAT_TYPE_ALLOW_INVALID
#define FORMAT_TYPE_INVALID_AS_NULL
void ReleaseSysCache(HeapTuple tuple)
int GetDatabaseEncoding(void)
int32 numeric_maximum_size(int32 typmod)
#define PG_RETURN_TEXT_P(x)
text * cstring_to_text(const char *s)
#define HeapTupleIsValid(tuple)
#define Assert(condition)
bool TypeIsVisible(Oid typid)
FormData_pg_type * Form_pg_type
void * repalloc(void *pointer, Size size)
char * get_namespace_name_or_temp(Oid nspid)