Re: includedir_internal headers are not self-contained

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Christoph Berg <cb(at)df7cb(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: includedir_internal headers are not self-contained
Date: 2014-04-28 13:51:56
Message-ID: 9364.1398693116@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> writes:
> On 04/28/2014 03:29 PM, Christoph Berg wrote:
>> Re: Heikki Linnakangas 2014-04-28 <535E09B7(dot)3090706(at)vmware(dot)com>
>>> I'm using it in the pg_rewind tool. It needs to know how to map relfilenodes
>>> to physical files.

>> Isn't pg_rewind so low-level server-close that it needs tons of server
>> headers anyway, including one that would still have relpath()? We are
>> talking here about what headers pure client apps need.

> It knows how to decode WAL, similar to pg_xlogdump. And it knows about
> the data directory layout, in particular, how relfilenodes are mapped to
> physical files. Those are the low-level parts. So, it certainly needs
> some server headers, but I wouldn't call it tons.

I'm not even worried about which headers this program uses. What I'm
worried about is that you've got CATALOG_VERSION_NO compiled into a
non-server executable. Is that really such a great idea? Wouldn't it be
better if pg_rewind did not depend on that? (Perhaps it should get the
database's catalog version out of the pg_control file, for example.)

In short, while I don't deny that there may be non-server programs
that need to know about physical file paths, I do strongly doubt
that relpath.h/.c in their current form are a good solution to that
problem.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-04-28 13:54:49 Re: allowing VACUUM to be cancelled for conflicting locks
Previous Message Alvaro Herrera 2014-04-28 13:47:09 Re: pgsql: Can't completely get rid of #ifndef FRONTEND in palloc.h :-(