Re: includedir_internal headers are not self-contained - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: includedir_internal headers are not self-contained
Date
Msg-id 535E4FD1.6000100@vmware.com
Whole thread Raw
In response to Re: includedir_internal headers are not self-contained  (Christoph Berg <cb@df7cb.de>)
Responses Re: includedir_internal headers are not self-contained  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 04/28/2014 03:29 PM, Christoph Berg wrote:
> Re: Heikki Linnakangas 2014-04-28 <535E09B7.3090706@vmware.com>
>>> Comments?  If there's anyone who has a really good use-case for using
>>> relpath() from outside the backend, better speak up.
>>
>> I'm using it in the pg_rewind tool. It needs to know how to map relfilenodes
>> to physical files.
>>
>> It has quite intimate knowledge of the on-disk layout anyway, so it wouldn't
>> be the end of the world to just copy-paste that code. But would rather not,
>> of course.
>
> 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.

- Heikki



pgsql-hackers by date:

Previous
From: amul sul
Date:
Subject: Different behaviour of concate() and concate operator ||
Next
From: Robert Haas
Date:
Subject: Re: Clock sweep not caching enough B-Tree leaf pages?