Re: Directory/File Access Permissions for COPY and Generic File Access Functions - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Directory/File Access Permissions for COPY and Generic File Access Functions
Date
Msg-id 20141028005845.GK28859@tamriel.snowman.net
Whole thread Raw
In response to Re: Directory/File Access Permissions for COPY and Generic File Access Functions  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
* Peter Eisentraut (peter_e@gmx.net) wrote:
> I think the way this should work is that if you create a DIRALIAS, then
> the COPY command should refer to it by logical name, e.g.,
>
> CREATE DIRALIAS dumpster AS '/tmp/trash';
> COPY mytable TO dumpster;

You'd have to be able to specify the filename also.  I'm not against the
idea of using the 'diralias' alias name this way, just saying it isn't
quite as simple as the above.

> If you squint a bit, this is the same as a tablespace.  Maybe those two
> concepts could be combined.

CREATE TABLESPACE is something else which could be supported with
diralias, though it'd have to be an independently grantable capability
and it'd be a bad idea to let a user create tablespaces in a directory
and then also be able to copy from/to files there (backend crashes,
etc).  This exact capability is more-or-less what RDS has had to hack on
to PG for their environment, as I understand it, in case you're looking
for a use-case.

> On the other hand, we already have file_fdw, which does something very
> similar.

It's really not at all the same..  Perhaps we'll get there some day, but
we're a very long way away from file_fdw having the ability to replace
normal tablespaces...
Thanks!
    Stephen

pgsql-hackers by date:

Previous
From: David G Johnston
Date:
Subject: Re: proposal: CREATE DATABASE vs. (partial) CHECKPOINT
Next
From: David G Johnston
Date:
Subject: Re: alter user/role CURRENT_USER