Re: file_fdw vs relative paths

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: file_fdw vs relative paths
Date: 2020-08-25 00:26:12
Message-ID: 20200825002612.GB24071@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 15, 2020 at 01:22:21PM +0200, Magnus Hagander wrote:
> According to the documentation, the filename given in file_fdw must be an
> absolute path. Hwever, it works perfectly fine with a relative path.
>
> So either the documentation is wrong, or the code is wrong. It behaves the same
> at least back to 9.5, I did not try it further back than that.

Yes, I tested back to 9.5 too:

CREATE EXTENSION file_fdw;
CREATE SERVER pgconf FOREIGN DATA WRAPPER file_fdw;
CREATE FOREIGN TABLE pgconf (line TEXT) SERVER pgconf OPTIONS ( filename
'postgresql.conf', format 'text', delimiter E'\x7f' );
SELECT * FROM pgconf;
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
...

> I can't find a reference to the code that limits this. AFAICT the documentation
> has been there since day 1.
>
> Question is, which one is right. Is there a reason we'd want to restrict it to
> absolute pathnames?

I think it should work just like COPY, which allows relative paths; doc
patch attached.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EnterpriseDB https://enterprisedb.com

The usefulness of a cup is in its emptiness, Bruce Lee

Attachment Content-Type Size
file.diff text/x-diff 505 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-08-25 01:34:51 Re: Continuing instability in insert-conflict-specconflict test
Previous Message Justin Pryzby 2020-08-25 00:06:25 Re: Row estimates for empty tables