summaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/deparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/postgres_fdw/deparse.c')
-rw-r--r--contrib/postgres_fdw/deparse.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/postgres_fdw/deparse.c b/contrib/postgres_fdw/deparse.c
index e5b5e1a5f51..f2fb0051843 100644
--- a/contrib/postgres_fdw/deparse.c
+++ b/contrib/postgres_fdw/deparse.c
@@ -1458,10 +1458,8 @@ deparseTargetList(StringInfo buf,
first = true;
for (i = 1; i <= tupdesc->natts; i++)
{
- Form_pg_attribute attr = TupleDescAttr(tupdesc, i - 1);
-
/* Ignore dropped attributes. */
- if (attr->attisdropped)
+ if (TupleDescCompactAttr(tupdesc, i - 1)->attisdropped)
continue;
if (have_wholerow ||
@@ -2150,7 +2148,7 @@ deparseInsertSql(StringInfo buf, RangeTblEntry *rte,
foreach(lc, targetAttrs)
{
int attnum = lfirst_int(lc);
- Form_pg_attribute attr = TupleDescAttr(tupdesc, attnum - 1);
+ CompactAttribute *attr = TupleDescCompactAttr(tupdesc, attnum - 1);
if (!first)
appendStringInfoString(buf, ", ");
@@ -2216,7 +2214,7 @@ rebuildInsertSql(StringInfo buf, Relation rel,
foreach(lc, target_attrs)
{
int attnum = lfirst_int(lc);
- Form_pg_attribute attr = TupleDescAttr(tupdesc, attnum - 1);
+ CompactAttribute *attr = TupleDescCompactAttr(tupdesc, attnum - 1);
if (!first)
appendStringInfoString(buf, ", ");
@@ -2266,7 +2264,7 @@ deparseUpdateSql(StringInfo buf, RangeTblEntry *rte,
foreach(lc, targetAttrs)
{
int attnum = lfirst_int(lc);
- Form_pg_attribute attr = TupleDescAttr(tupdesc, attnum - 1);
+ CompactAttribute *attr = TupleDescCompactAttr(tupdesc, attnum - 1);
if (!first)
appendStringInfoString(buf, ", ");