From 8cda1fadd25b8bd9448c7d161354643906c85650 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Tue, 22 Aug 2017 07:46:05 -0700 Subject: [PATCH] Backpatch introduction of TupleDescAttr(tupdesc, i). 2cd70845240 / c6293249d change the way individual attributes in a TupleDesc are stored / accessed. To reduce the effort of making extensions compatible with postgresql 11, and to ease future backpatching, backpatch introduction of TupleDescAttr() to all releases. Do not backpatch change in storage, as that'd be a breaking change for existing and working extensions. Author: Andres Freund Discussion: https://postgr.es/m/20170820181723.tdswdinzptbcwhrr@alap3.anarazel.de Backpatch: 9.2- --- src/include/access/tupdesc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h index be42b544d5e..f96ea189066 100644 --- a/src/include/access/tupdesc.h +++ b/src/include/access/tupdesc.h @@ -81,6 +81,9 @@ typedef struct tupleDesc } *TupleDesc; +/* Accessor for the i'th attribute of tupdesc. */ +#define TupleDescAttr(tupdesc, i) ((tupdesc)->attrs[(i)]) + extern TupleDesc CreateTemplateTupleDesc(int natts, bool hasoid); extern TupleDesc CreateTupleDesc(int natts, bool hasoid, -- 2.47.3