Re: PG12, PGXS and linking pgfeutils

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Ian Barwick <ian(dot)barwick(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PG12, PGXS and linking pgfeutils
Date: 2019-05-09 17:47:12
Message-ID: 27315.1557424032@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> writes:
> On 2019-May-09, Tom Lane wrote:
>> I'm not especially on board with the idea of moving FE-specific error
>> handling code into libpgcommon, as that breaks the concept that
>> src/common/ is broadly for code that can work in either frontend or
>> backend contexts. However, we already have a few violations of that
>> rule: common/Makefile already has
>>
>> # A few files are currently only built for frontend, not server
>> OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o file_utils.o restricted_token.o
>>
>> So maybe the answer is to move these logging support functions into
>> src/common, in a file that's only built for frontend.

> I wonder if a better solution isn't to move the file_utils stuff to
> fe_utils. Half of it is frontend-specific. The only one that should be
> shared to backend seems to be fsync_fname ... but instead of sharing it,
> we have a second copy in fd.c.

Hm, if file_utils is the only thing in common/ that uses this, and we
expect that to remain true, that would fix the issue. But ...

The thing I was looking at was mainly fe_memutils, which is justifiably
here on the grounds that it provides backend-like palloc support and
thereby eases the task of making other common/ modules work in both
contexts. If we built elog/ereport emulations on top of Peter's logging
functions, there'd be a very clear case for having that in common/.
Peter didn't do that for v12, but I hope we get there at some point.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-05-09 18:08:39 Re: Inconsistent error message wording for REINDEX CONCURRENTLY
Previous Message Bruce Momjian 2019-05-09 17:42:34 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)