*/
TupleConversionMap *
convert_tuples_by_name(TupleDesc indesc,
- TupleDesc outdesc,
- const char *msg)
+ TupleDesc outdesc)
{
TupleConversionMap *map;
AttrNumber *attrMap;
int n = outdesc->natts;
/* Verify compatibility and prepare attribute-number map */
- attrMap = convert_tuples_by_name_map_if_req(indesc, outdesc, msg);
+ attrMap = convert_tuples_by_name_map_if_req(indesc, outdesc);
if (attrMap == NULL)
{
*/
AttrNumber *
convert_tuples_by_name_map(TupleDesc indesc,
- TupleDesc outdesc,
- const char *msg)
+ TupleDesc outdesc)
{
AttrNumber *attrMap;
int outnatts;
if (atttypid != inatt->atttypid || atttypmod != inatt->atttypmod)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg_internal("%s", _(msg)),
+ errmsg("could not convert row type"),
errdetail("Attribute \"%s\" of type %s does not match corresponding attribute of type %s.",
attname,
format_type_be(outdesc->tdtypeid),
if (attrMap[i] == 0)
ereport(ERROR,
(errcode(ERRCODE_DATATYPE_MISMATCH),
- errmsg_internal("%s", _(msg)),
+ errmsg("could not convert row type"),
errdetail("Attribute \"%s\" of type %s does not exist in type %s.",
attname,
format_type_be(outdesc->tdtypeid),
*/
AttrNumber *
convert_tuples_by_name_map_if_req(TupleDesc indesc,
- TupleDesc outdesc,
- const char *msg)
+ TupleDesc outdesc)
{
AttrNumber *attrMap;
int n = outdesc->natts;
bool same;
/* Verify compatibility and prepare attribute-number map */
- attrMap = convert_tuples_by_name_map(indesc, outdesc, msg);
+ attrMap = convert_tuples_by_name_map(indesc, outdesc);
/*
* Check to see if the map is one-to-one, in which case we need not do a
AttrNumber *part_attnos;
part_attnos = convert_tuples_by_name_map(RelationGetDescr(to_rel),
- RelationGetDescr(from_rel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(from_rel));
expr = (List *) map_variable_attnos((Node *) expr,
fromrel_varno, 0,
part_attnos,
TupleConversionMap *map;
map = convert_tuples_by_name(RelationGetDescr(childrel),
- RelationGetDescr(onerel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(onerel));
if (map != NULL)
{
int j;
childidxs = RelationGetIndexList(childrel);
attmap =
convert_tuples_by_name_map(RelationGetDescr(childrel),
- parentDesc,
- gettext_noop("could not convert row type"));
+ parentDesc);
maplen = parentDesc->natts;
foreach(cell, childidxs)
}
attmap = convert_tuples_by_name_map(RelationGetDescr(rel),
- RelationGetDescr(parent),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(parent));
idxstmt =
generateClonedIndexStmt(NULL, idxRel,
attmap, RelationGetDescr(rel)->natts,
* definition to match the partition's column layout.
*/
map = convert_tuples_by_name_map_if_req(RelationGetDescr(partRel),
- RelationGetDescr(pkrel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(pkrel));
if (map)
{
mapped_pkattnum = palloc(sizeof(AttrNumber) * numfks);
CheckTableNotInUse(partition, "ALTER TABLE");
attmap = convert_tuples_by_name_map(RelationGetDescr(partition),
- RelationGetDescr(rel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(rel));
for (int j = 0; j < numfks; j++)
mapped_fkattnum[j] = attmap[fkattnum[j] - 1];
table_close(pg_constraint, RowShareLock);
attmap = convert_tuples_by_name_map(RelationGetDescr(partitionRel),
- RelationGetDescr(parentRel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(parentRel));
foreach(cell, clone)
{
Oid constrOid = lfirst_oid(cell);
* different. This map is used to convert them.
*/
attmap = convert_tuples_by_name_map(RelationGetDescr(partRel),
- RelationGetDescr(parentRel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(parentRel));
partFKs = copyObject(RelationGetFKeyList(partRel));
cmd = copyObject(cmd);
attmap = convert_tuples_by_name_map(RelationGetDescr(childrel),
- RelationGetDescr(rel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(rel));
((ColumnDef *) cmd->def)->cooked_default =
map_variable_attnos(def->cooked_default,
1, 0,
/* construct an indexinfo to compare existing indexes against */
info = BuildIndexInfo(idxRel);
attmap = convert_tuples_by_name_map(RelationGetDescr(attachrel),
- RelationGetDescr(rel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(rel));
constraintOid = get_relation_idx_constraint_oid(RelationGetRelid(rel), idx);
/*
childInfo = BuildIndexInfo(partIdx);
parentInfo = BuildIndexInfo(parentIdx);
attmap = convert_tuples_by_name_map(RelationGetDescr(partTbl),
- RelationGetDescr(parentTbl),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(parentTbl));
if (!CompareIndexInfo(childInfo, parentInfo,
partIdx->rd_indcollation,
parentIdx->rd_indcollation,
old_cxt = MemoryContextSwitchTo(econtext->ecxt_per_query_memory);
/* prepare map from old to new attribute numbers */
- op->d.convert_rowtype.map =
- convert_tuples_by_name(indesc, outdesc,
- gettext_noop("could not convert row type"));
+ op->d.convert_rowtype.map = convert_tuples_by_name(indesc, outdesc);
op->d.convert_rowtype.initialized = true;
MemoryContextSwitchTo(old_cxt);
old_tupdesc = RelationGetDescr(resultRelInfo->ri_RelationDesc);
/* a reverse map */
- map = convert_tuples_by_name_map_if_req(old_tupdesc, tupdesc,
- gettext_noop("could not convert row type"));
+ map = convert_tuples_by_name_map_if_req(old_tupdesc, tupdesc);
/*
* Partition-specific slot's tupdesc can't be changed, so allocate a
tupdesc = RelationGetDescr(rel);
/* a reverse map */
map = convert_tuples_by_name_map_if_req(orig_tupdesc,
- tupdesc,
- gettext_noop("could not convert row type"));
+ tupdesc);
/*
* Partition-specific slot's tupdesc can't be changed, so
tupdesc = RelationGetDescr(rel);
/* a reverse map */
map = convert_tuples_by_name_map_if_req(old_tupdesc,
- tupdesc,
- gettext_noop("could not convert row type"));
+ tupdesc);
/*
* Partition-specific slot's tupdesc can't be changed, so
tupdesc = RelationGetDescr(rel);
/* a reverse map */
map = convert_tuples_by_name_map_if_req(old_tupdesc,
- tupdesc,
- gettext_noop("could not convert row type"));
+ tupdesc);
/*
* Partition-specific slot's tupdesc can't be changed,
*/
part_attnos =
convert_tuples_by_name_map(RelationGetDescr(partrel),
- RelationGetDescr(firstResultRel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(firstResultRel));
wcoList = (List *)
map_variable_attnos((Node *) wcoList,
firstVarno, 0,
if (part_attnos == NULL)
part_attnos =
convert_tuples_by_name_map(RelationGetDescr(partrel),
- RelationGetDescr(firstResultRel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(firstResultRel));
returningList = (List *)
map_variable_attnos((Node *) returningList,
firstVarno, 0,
if (part_attnos == NULL)
part_attnos =
convert_tuples_by_name_map(RelationGetDescr(partrel),
- RelationGetDescr(firstResultRel),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(firstResultRel));
onconflset = (List *)
map_variable_attnos((Node *) onconflset,
INNER_VAR, 0,
*/
partrouteinfo->pi_RootToPartitionMap =
convert_tuples_by_name(RelationGetDescr(partRelInfo->ri_PartitionRoot),
- RelationGetDescr(partRelInfo->ri_RelationDesc),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(partRelInfo->ri_RelationDesc));
/*
* If a partition has a different rowtype than the root parent, initialize
{
partrouteinfo->pi_PartitionToRootMap =
convert_tuples_by_name(RelationGetDescr(partRelInfo->ri_RelationDesc),
- RelationGetDescr(partRelInfo->ri_PartitionRoot),
- gettext_noop("could not convert row type"));
+ RelationGetDescr(partRelInfo->ri_PartitionRoot));
}
else
partrouteinfo->pi_PartitionToRootMap = NULL;
* routing.
*/
pd->tupmap = convert_tuples_by_name_map_if_req(RelationGetDescr(parent_pd->reldesc),
- tupdesc,
- gettext_noop("could not convert row type"));
+ tupdesc);
pd->tupslot = pd->tupmap ?
MakeSingleTupleTableSlot(tupdesc, &TTSOpsVirtual) : NULL;
}
{
mtstate->mt_per_subplan_tupconv_maps[i] =
convert_tuples_by_name(RelationGetDescr(resultRelInfos[i].ri_RelationDesc),
- outdesc,
- gettext_noop("could not convert row type"));
+ outdesc);
}
}
const char *msg);
extern TupleConversionMap *convert_tuples_by_name(TupleDesc indesc,
- TupleDesc outdesc,
- const char *msg);
+ TupleDesc outdesc);
extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
- TupleDesc outdesc,
- const char *msg);
+ TupleDesc outdesc);
extern AttrNumber *convert_tuples_by_name_map_if_req(TupleDesc indesc,
- TupleDesc outdesc,
- const char *msg);
+ TupleDesc outdesc);
extern HeapTuple execute_attr_map_tuple(HeapTuple tuple, TupleConversionMap *map);
extern TupleTableSlot *execute_attr_map_slot(AttrNumber *attrMap,