Re: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend
Date
Msg-id 20130108203618.GB9218@alvh.no-ip.org
Whole thread Raw
In response to Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend  (Andres Freund <andres@2ndquadrant.com>)
Responses Re: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend
Re: Re: [PATCH 1/5] Centralize Assert* macros into c.h so its common between backend/frontend
List pgsql-hackers
Andres Freund wrote:
> On 2013-01-08 14:35:12 -0500, Tom Lane wrote:
> > Andres Freund <andres@2ndquadrant.com> writes:
> > > On 2013-01-08 14:25:06 -0500, Tom Lane wrote:
> > >> This patch seems unnecessary given that we already put a version of Assert()
> > >> into postgres_fe.h.
> >
> > > The problem is that some (including existing) pieces of code need to
> > > include postgres.h itself, those can't easily include postgres_fe.h as
> > > well without getting into problems with redefinitions.
> >
> > There is no place, anywhere, that should be including both.  So I don't
> > see the problem.
>
> Sorry, misremembered the problem somewhat. The problem is that code that
> includes postgres.h atm ends up with ExceptionalCondition() et
> al. declared even if FRONTEND is defined. So if anything uses an assert
> you need to provide wrappers for those which seems nasty. If they are
> provided centrally and check for FRONTEND that problem doesn't exist.

I think the right fix here is to fix things so that postgres.h is not
necessary.  How hard is that?  Maybe it just requires some more
reshuffling of xlog headers.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Cascading replication: should we detect/prevent cycles?
Next
From: Alvaro Herrera
Date:
Subject: Re: [PATCH 2/5] Make relpathbackend return a statically result instead of palloc()'ing it