79 Node *escontext = fcinfo->context;
105 errmsg(
"input of anonymous composite types is not implemented")));
113 ncolumns = tupdesc->
natts;
123 fcinfo->flinfo->fn_extra =
152 while (*ptr &&
isspace((
unsigned char) *ptr))
158 errmsg(
"malformed record literal: \"%s\"",
string),
159 errdetail(
"Missing left parenthesis.")));
165 for (
i = 0;
i < ncolumns;
i++)
169 Oid column_type =
att->atttypid;
173 if (
att->attisdropped)
190 errmsg(
"malformed record literal: \"%s\"",
string),
197 if (*ptr ==
',' || *ptr ==
')')
208 while (
inquote || !(*ptr ==
',' || *ptr ==
')'))
216 errmsg(
"malformed record literal: \"%s\"",
227 errmsg(
"malformed record literal: \"%s\"",
238 else if (*ptr ==
'"')
263 fcinfo->flinfo->fn_mcxt);
285 errmsg(
"malformed record literal: \"%s\"",
string),
290 while (*ptr &&
isspace((
unsigned char) *ptr))
296 errmsg(
"malformed record literal: \"%s\"",
string),
297 errdetail(
"Junk after right parenthesis.")));
350 ncolumns = tupdesc->
natts;
366 fcinfo->flinfo->fn_extra =
397 for (
i = 0;
i < ncolumns;
i++)
401 Oid column_type =
att->atttypid;
408 if (
att->attisdropped)
430 fcinfo->flinfo->fn_mcxt);
439 for (tmp =
value; *tmp; tmp++)
443 if (
ch ==
'"' ||
ch ==
'\\' ||
444 ch ==
'(' ||
ch ==
')' ||
ch ==
',' ||
455 for (tmp =
value; *tmp; tmp++)
459 if (
ch ==
'"' ||
ch ==
'\\')
509 errmsg(
"input of anonymous composite types is not implemented")));
512 ncolumns = tupdesc->
natts;
522 fcinfo->flinfo->fn_extra =
550 for (
i = 0;
i < ncolumns;
i++)
558 errmsg(
"wrong number of columns: %d, expected %d",
562 for (
i = 0;
i < ncolumns;
i++)
566 Oid column_type =
att->atttypid;
573 if (
att->attisdropped)
599 errmsg(
"binary data has type %u (%s) instead of expected %u (%s) in record column %d",
613 errmsg(
"insufficient data left in message")));
645 fcinfo->flinfo->fn_mcxt);
660 errmsg(
"improper binary format in record column %d",
708 ncolumns = tupdesc->
natts;
724 fcinfo->flinfo->fn_extra =
755 for (
i = 0;
i < ncolumns;
i++)
762 for (
i = 0;
i < ncolumns;
i++)
766 Oid column_type =
att->atttypid;
771 if (
att->attisdropped)
792 fcinfo->flinfo->fn_mcxt);
946 if (
att1->atttypid !=
att2->atttypid)
949 errmsg(
"cannot compare dissimilar column types %s and %s at record column %d",
958 collation =
att1->attcollation;
959 if (collation !=
att2->attcollation)
965 typentry =
my_extra->columns[
j].typentry;
966 if (typentry ==
NULL ||
974 errmsg(
"could not identify a comparison function for type %s",
976 my_extra->columns[
j].typentry = typentry;
1040 errmsg(
"cannot compare record types with different numbers of columns")));
1123 fcinfo->flinfo->fn_extra =
1192 if (
att1->atttypid !=
att2->atttypid)
1195 errmsg(
"cannot compare dissimilar column types %s and %s at record column %d",
1204 collation =
att1->attcollation;
1205 if (collation !=
att2->attcollation)
1211 typentry =
my_extra->columns[
j].typentry;
1212 if (typentry ==
NULL ||
1220 errmsg(
"could not identify an equality operator for type %s",
1222 my_extra->columns[
j].typentry = typentry;
1265 errmsg(
"cannot compare record types with different numbers of columns")));
1468 if (
att1->atttypid !=
att2->atttypid)
1471 errmsg(
"cannot compare dissimilar column types %s and %s at record column %d",
1508 else if (
att1->attlen > 0)
1514 else if (
att1->attlen == -1)
1568 errmsg(
"cannot compare record types with different numbers of columns")));
1649 fcinfo->flinfo->fn_extra =
1714 if (
att1->atttypid !=
att2->atttypid)
1717 errmsg(
"cannot compare dissimilar column types %s and %s at record column %d",
1753 errmsg(
"cannot compare record types with different numbers of columns")));
1831 ncolumns = tupdesc->
natts;
1847 fcinfo->flinfo->fn_extra =
1870 for (
int i = 0;
i < ncolumns;
i++)
1878 if (
att->attisdropped)
1884 typentry =
my_extra->columns[
i].typentry;
1885 if (typentry ==
NULL ||
1893 errmsg(
"could not identify a hash function for type %s",
1895 my_extra->columns[
i].typentry = typentry;
1952 ncolumns = tupdesc->
natts;
1968 fcinfo->flinfo->fn_extra =
1991 for (
int i = 0;
i < ncolumns;
i++)
1999 if (
att->attisdropped)
2005 typentry =
my_extra->columns[
i].typentry;
2006 if (typentry ==
NULL ||
2014 errmsg(
"could not identify an extended hash function for type %s",
2016 my_extra->columns[
i].typentry = typentry;
static uint32 element_hash(const void *key, Size keysize)
static Datum values[MAXATTR]
#define FORMAT_TYPE_ALLOW_INVALID
#define Assert(condition)
#define FLEXIBLE_ARRAY_MEMBER
#define MemSet(start, val, len)
#define OidIsValid(objectId)
bool datum_image_eq(Datum value1, Datum value2, bool typByVal, int typLen)
Size toast_raw_datum_size(Datum value)
int errdetail(const char *fmt,...)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereturn(context, dummy_value,...)
#define errsave(context,...)
#define ereport(elevel,...)
#define palloc_array(type, count)
void fmgr_info_cxt(Oid functionId, FmgrInfo *finfo, MemoryContext mcxt)
bytea * SendFunctionCall(FmgrInfo *flinfo, Datum val)
bool InputFunctionCallSafe(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod, Node *escontext, Datum *result)
char * OutputFunctionCall(FmgrInfo *flinfo, Datum val)
Datum ReceiveFunctionCall(FmgrInfo *flinfo, StringInfo buf, Oid typioparam, int32 typmod)
#define PG_FREE_IF_COPY(ptr, n)
#define PG_RETURN_UINT32(x)
#define PG_RETURN_BYTEA_P(x)
#define PG_GETARG_POINTER(n)
#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Collation, Context, Resultinfo)
#define PG_RETURN_CSTRING(x)
#define PG_GETARG_DATUM(n)
#define LOCAL_FCINFO(name, nargs)
#define PG_GETARG_CSTRING(n)
#define PG_GETARG_INT64(n)
#define PG_DETOAST_DATUM_PACKED(datum)
#define PG_RETURN_UINT64(x)
#define PG_GETARG_HEAPTUPLEHEADER(n)
#define FunctionCallInvoke(fcinfo)
#define PG_RETURN_INT32(x)
#define PG_RETURN_HEAPTUPLEHEADER(x)
#define PG_GETARG_INT32(n)
#define PG_RETURN_DATUM(x)
#define PG_RETURN_BOOL(x)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc, Datum *values, bool *isnull)
void heap_freetuple(HeapTuple htup)
HeapTupleHeaderData * HeapTupleHeader
static int32 HeapTupleHeaderGetTypMod(const HeapTupleHeaderData *tup)
static uint32 HeapTupleHeaderGetDatumLength(const HeapTupleHeaderData *tup)
static Oid HeapTupleHeaderGetTypeId(const HeapTupleHeaderData *tup)
static void ItemPointerSetInvalid(ItemPointerData *pointer)
void getTypeBinaryOutputInfo(Oid type, Oid *typSend, bool *typIsVarlena)
void getTypeOutputInfo(Oid type, Oid *typOutput, bool *typIsVarlena)
void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam)
void getTypeBinaryInputInfo(Oid type, Oid *typReceive, Oid *typIOParam)
void * MemoryContextAlloc(MemoryContext context, Size size)
void pfree(void *pointer)
FormData_pg_attribute * Form_pg_attribute
static char buf[DEFAULT_XLOG_SEG_SIZE]
static uint32 DatumGetUInt32(Datum X)
static Datum Int64GetDatum(int64 X)
static uint64 DatumGetUInt64(Datum X)
static bool DatumGetBool(Datum X)
static Pointer DatumGetPointer(Datum X)
static int32 DatumGetInt32(Datum X)
Datum record_eq(PG_FUNCTION_ARGS)
static int record_cmp(FunctionCallInfo fcinfo)
Datum record_image_ne(PG_FUNCTION_ARGS)
Datum record_image_ge(PG_FUNCTION_ARGS)
Datum hash_record_extended(PG_FUNCTION_ARGS)
Datum record_larger(PG_FUNCTION_ARGS)
Datum record_out(PG_FUNCTION_ARGS)
Datum record_ge(PG_FUNCTION_ARGS)
Datum btrecordcmp(PG_FUNCTION_ARGS)
Datum record_recv(PG_FUNCTION_ARGS)
Datum record_image_lt(PG_FUNCTION_ARGS)
Datum hash_record(PG_FUNCTION_ARGS)
Datum record_image_gt(PG_FUNCTION_ARGS)
Datum btrecordimagecmp(PG_FUNCTION_ARGS)
Datum record_in(PG_FUNCTION_ARGS)
Datum record_send(PG_FUNCTION_ARGS)
Datum record_image_le(PG_FUNCTION_ARGS)
Datum record_ne(PG_FUNCTION_ARGS)
Datum record_le(PG_FUNCTION_ARGS)
Datum record_smaller(PG_FUNCTION_ARGS)
Datum record_image_eq(PG_FUNCTION_ARGS)
static int record_image_cmp(FunctionCallInfo fcinfo)
Datum record_lt(PG_FUNCTION_ARGS)
Datum record_gt(PG_FUNCTION_ARGS)
void check_stack_depth(void)
struct StringInfoData * StringInfo
void resetStringInfo(StringInfo str)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
#define appendStringInfoCharMacro(str, ch)
static void initReadOnlyStringInfo(StringInfo str, char *data, int len)
TypeCacheEntry * typentry
ColumnCompareData columns[FLEXIBLE_ARRAY_MEMBER]
ColumnIOData columns[FLEXIBLE_ARRAY_MEMBER]
FmgrInfo hash_extended_proc_finfo
#define FirstGenbkiObjectId
#define ReleaseTupleDesc(tupdesc)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
TupleDesc lookup_rowtype_tupdesc(Oid type_id, int32 typmod)
TypeCacheEntry * lookup_type_cache(Oid type_id, int flags)
#define TYPECACHE_HASH_PROC_FINFO
#define TYPECACHE_EQ_OPR_FINFO
#define TYPECACHE_HASH_EXTENDED_PROC_FINFO
#define TYPECACHE_CMP_PROC_FINFO
static Size VARSIZE(const void *PTR)
static char * VARDATA(const void *PTR)
static char * VARDATA_ANY(const void *PTR)