Re: hiding variable-length fields from Form_pg_* structs
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2011-11-27T23:20:18Z
Lists: pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> CATALOG(pg_attribute,1249) BKI_BOOTSTRAP ...
> {
> ...
> int4 attinhcount;
> Oid attcollation;
> aclitem attacl[1];
> CATVARLEN(
> text attoptions[1];
> text attfdwoptions[1];
> )
> } FormData_pg_attribute;
> where CATVARLEN is defined empty in C, and ignored in the BKI generation
> code.
> The real trick is to find something that handles well with pgindent and
> indenting text editors.
The low-tech way would be
CATALOG(pg_attribute,1249) BKI_BOOTSTRAP ...
{
...
int4 attinhcount;
Oid attcollation;
aclitem attacl[1];
#ifdef CATALOG_VARLEN_FIELDS
text attoptions[1];
text attfdwoptions[1];
#endif
} FormData_pg_attribute;
regards, tom lane