Re: Move catalog toast table and index declarations

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Move catalog toast table and index declarations
Date: 2020-11-05 18:20:06
Message-ID: 281df85e-5667-57b0-a5e8-88bfc455c14d@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-11-05 12:59, John Naylor wrote:
> I think we're talking past eachother. Here's a concrete example:
>
> #define BKI_ROWTYPE_OID(oid,oidmacro)
> #define DECLARE_TOAST(name,toastoid,indexoid) extern int no_such_variable
>
> I understand these to be functionally equivalent as far as what the C
> compiler sees.

The issue is that you can't have a bare semicolon at the top level of a
C compilation unit, at least on some compilers. So doing

#define FOO(stuff) /*empty*/

and then

FOO(123);

won't work. You need to fill the definition of FOO with some stuff to
make it valid.

BKI_ROWTYPE_OID on the other hand is not used at the top level like
this, so it can be defined to empty.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2020-11-05 19:22:10 Re: libpq compression
Previous Message Matthias van de Meent 2020-11-05 18:07:34 Re: libpq compression