Backpatch introduction of TupleDescAttr(tupdesc, i).
authorAndres Freund
Tue, 22 Aug 2017 14:46:05 +0000 (07:46 -0700)
committerAndres Freund
Tue, 22 Aug 2017 14:47:46 +0000 (07:47 -0700)
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[email protected]
Backpatch: 9.2-

src/include/access/tupdesc.h

index 91b0034d14bd134c0301bf5c1b734cdef18ed8cd..1e8fdc6a6c1966e3f3ca4ce7b642be23955cbabf 100644 (file)
@@ -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,