Re: Directory/File Access Permissions for COPY and Generic File Access Functions

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Brightwell, Adam" <adam(dot)brightwell(at)crunchydatasolutions(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Directory/File Access Permissions for COPY and Generic File Access Functions
Date: 2014-10-28 00:58:45
Message-ID: 20141028005845.GK28859@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Peter Eisentraut (peter_e(at)gmx(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G Johnston 2014-10-28 01:28:12 Re: alter user/role CURRENT_USER
Previous Message David G Johnston 2014-10-28 00:56:51 Re: proposal: CREATE DATABASE vs. (partial) CHECKPOINT