How to Know the number of attrs?

From: jacktby jacktby <jacktby(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: How to Know the number of attrs?
Date: 2023-09-24 12:56:51
Message-ID: CAC38B03-44E6-4E42-9DE4-0DD52D543F60@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

typedef struct TupleDescData
{
int natts; /* number of attributes in the tuple */
Oid tdtypeid; /* composite type ID for tuple type */
int32 tdtypmod; /* typmod for tuple type */
int tdrefcount; /* reference count, or -1 if not counting */
TupleConstr *constr; /* constraints, or NULL if none */
/* attrs[N] is the description of Attribute Number N+1 */
FormData_pg_attribute attrs[FLEXIBLE_ARRAY_MEMBER];
} TupleDescData;

Hi, the attrs use FLEXIBLE_ARRAY_MEMBER, so which API should I use to get the real length of this array?

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message jacktby jacktby 2023-09-24 12:57:33 How to Know the number of attrs?
Previous Message Kuwamura Masaki 2023-09-24 08:22:23 Re: bug fix and documentation improvement about vacuumdb