Re: pgsql: Refactor attribute mappings used in logical tuple conversion

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Refactor attribute mappings used in logical tuple conversion
Date: 2019-12-18 14:37:33
Message-ID: 2517.1576679853@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Michael Paquier <michael(at)paquier(dot)xyz> writes:
> Hmm. All buildfarm members are happy with this change, except
> prairiedog which is picky about the part in rewriteManip.h

It's not only prairiedog --- my RHEL6 workstation (gcc 4.4.7) is failing
as well, and I see buildfarm member grouse is unhappy too.

> In file included from index.c:66:
> ../../../src/include/rewrite/rewriteManip.h:20: error: redefinition of
> typedef 'AttrMap'

This is simply the wrong way to do it. What you have to do, if you
want to not include attmap.h here, is to say

struct AttrMap;

(no typedef) and then refer to it as "struct AttrMap" in the rest
of the header file. There are lots of other examples in our headers.

BTW, it's also conventional to add a comment saying "this is to
avoid including foo.h", or equivalent.

TBH, though, I wonder if this doesn't indicate you've put this
function in the wrong header to begin with. Why does it belong
in rewriteManip?

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-12-18 15:22:53 pgsql: Minimal portability fix for commit e1551f96e.
Previous Message Michael Paquier 2019-12-18 10:13:38 Re: pgsql: Refactor attribute mappings used in logical tuple conversion