aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2016-03-15 16:51:56 -0400
committerRobert Haas <rhaas@postgresql.org>2016-03-15 16:51:56 -0400
commit4a46a99d8936328ab00e54bf8a2900832c4687e7 (patch)
tree28ee037798f973a519bd5b1c2dc0bc694e17d0e6 /contrib/postgres_fdw/postgres_fdw.c
parent2a90cb69e18e0c0637f3f93702e7b2f7808ff1b2 (diff)
downloadpostgresql-4a46a99d8936328ab00e54bf8a2900832c4687e7.tar.gz
postgresql-4a46a99d8936328ab00e54bf8a2900832c4687e7.zip
postgres_fdw: make_tuple_from_result_row should set cur_attno for ctid.
There's no reason for this function to do this for every other attribute number and omit it for CTID, especially since conversion_error_callback has code to handle that case. This seems to be an oversight in commit e690b9515072fd7767fdeca5c54166f6a77733bc. Etsuro Fujita
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r--contrib/postgres_fdw/postgres_fdw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 96875b41848..e446cc5645a 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -3803,18 +3803,17 @@ make_tuple_from_result_row(PGresult *res,
valstr = PQgetvalue(res, row, j);
/* convert value to internal representation */
+ errpos.cur_attno = i;
if (i > 0)
{
/* ordinary column */
Assert(i <= tupdesc->natts);
nulls[i - 1] = (valstr == NULL);
/* Apply the input function even to nulls, to support domains */
- errpos.cur_attno = i;
values[i - 1] = InputFunctionCall(&attinmeta->attinfuncs[i - 1],
valstr,
attinmeta->attioparams[i - 1],
attinmeta->atttypmods[i - 1]);
- errpos.cur_attno = 0;
}
else if (i == SelfItemPointerAttributeNumber)
{
@@ -3827,6 +3826,7 @@ make_tuple_from_result_row(PGresult *res,
ctid = (ItemPointer) DatumGetPointer(datum);
}
}
+ errpos.cur_attno = 0;
j++;
}