Re: pgsql: Refactor attribute mappings used in logical tuple conversion - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Refactor attribute mappings used in logical tuple conversion
Date
Msg-id 2517.1576679853@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Refactor attribute mappings used in logical tupleconversion  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pgsql: Refactor attribute mappings used in logical tuple conversion  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-committers
Michael Paquier <michael@paquier.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



pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Refactor attribute mappings used in logical tupleconversion
Next
From: Tom Lane
Date:
Subject: pgsql: Minimal portability fix for commit e1551f96e.