Alex Pilosov <alex@pilosoft.com> writes:
> True true. On other hand, unlike union, its automatically typechecked, you
> cannot by mistake reference a field you shouldn't be referencing.
Only true to the extent that you have cast a generic pointer to the
correct type to begin with. However, we've probably wasted more time
arguing the point than it's really worth.
I would suggest leaving off the final semicolon in the macro definition
so that you can write
typedef struct RangeTblEntryRelation
{ RTE_COMMON_FIELDS; /* Fields valid for a plain relation RTE */ char *relname; /* real name of the
relation*/ Oid relid; /* OID of the relation */
Without this, tools like pgindent will almost certainly mess up these
struct declarations (I know emacs' C mode will get it wrong...)
regards, tom lane