Re: postgres.h included from relcache.h - but removing it breaks pg_upgrade

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Alexander Korotkov <akorotkov(at)postgresql(dot)org>
Subject: Re: postgres.h included from relcache.h - but removing it breaks pg_upgrade
Date: 2021-09-18 18:58:36
Message-ID: CAPpHfdsnZeE7rT7U6+C_xYnAvZt+RRT2HPv3M7enZsEsqMfUuA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Sat, Sep 18, 2021 at 3:06 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2021-09-18 02:51:09 +0300, Alexander Korotkov wrote:
> > On Tue, Sep 14, 2021 at 6:53 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > > Without having looked at the details, I think using a forward-declare
> > > to avoid including relcache.h in visibilitymap.h might be a reasonably
> > > non-painful fix.
> >
> > I like that idea, but I didn't find an appropriate existing header for
> > forward-declaration of Relation. relation.h isn't suitable, because
> > it includes primnodes.h. A separate header for just
> > forward-definition of Relation seems too much.
>
> I was just thinking of doing something like the attached.

I see now. I think I'm rather favoring splitting visibilitymap.h.

> > > TOH, in the long run it might be worth the effort
> > > to split visibilitymap.h to separate useful file-contents knowledge
> > > from backend function declarations.
> >
> > I've drafted a patch splitting visibilitymap_maros.h from
> > visibilitymap.h. What do you think?
>
> I'd name it visibilitymapdefs.h or such, mostly because that's what other
> headers are named like...

Good point. The revised patch is attached.

------
Regards,
Alexander Korotkov

Attachment Content-Type Size
0001-Split-macros-from-visibilitymap.h-into-a-separate--2.patch application/x-patch 3.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2021-09-18 20:19:04 Re: Timeout failure in 019_replslot_limit.pl
Previous Message Zhihong Yu 2021-09-18 17:59:38 Re: So, about that cast-to-typmod-minus-one business