* Peter Eisentraut (pete...@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

Attachment: signature.asc
Description: Digital signature

Reply via email to