Re: pg_basebackup fails with long tablespace paths - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: pg_basebackup fails with long tablespace paths
Date
Msg-id 54593C7C.5080503@gmx.net
Whole thread Raw
In response to Re: pg_basebackup fails with long tablespace paths  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: pg_basebackup fails with long tablespace paths  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On 10/20/14 4:51 PM, Peter Eisentraut wrote:
> On 10/20/14 2:59 PM, Tom Lane wrote:
>> What do we want to do about this?  I think a minimum expectation would be
>> for pg_basebackup to notice and complain when it's trying to create an
>> unworkably long symlink entry, but it would be far better if we found a
>> way to cope instead.
>
> Isn't it the backend that should error out before sending truncated
> files names?
>
> src/port/tar.c:
>
>     /* Name 100 */
>     sprintf(&h[0], "%.99s", filename);

Here are patches to address that.  First, it reports errors when
attempting to create a tar header that would truncate file or symlink
names.  Second, it works around the problem in the tests by creating a
symlink from the short-name tempdir that we had set up for the
Unix-socket directory case.

The first patch can be backpatched to 9.3.  The tar code before that is
different and would need manual adjustments.

If someone has a too-long tablespace path, I think they can work around
that after this patch by creating a shorter symlink and updating the
pg_tblspc symlinks to point there.

Attachment

pgsql-hackers by date:

Previous
From: Mikko Tiihonen
Date:
Subject: Re: [JDBC] Pipelining executions to postgresql server
Next
From: Petr Jelinek
Date:
Subject: Re: Sequence Access Method WIP