Skip site navigation (1) Skip section navigation (2)

Re: [PATCH] COPY .. COMPRESSED

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Christopher Browne <cbbrowne(at)gmail(dot)com>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] COPY .. COMPRESSED
Date: 2013-01-15 20:42:48
Message-ID: 20130115204248.GH27934@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, Jan 15, 2013 at 03:37:07PM -0500, Christopher Browne wrote:
> On Tue, Jan 15, 2013 at 2:53 PM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> > The popen patch doesn't support the '|compression-binary' option through
> > the FE protocol.  Even if it did, it would only be available for
> > superusers as we can't allow regular users to run arbitrary commands on
> > the server-side.
> 
> That points towards a fix that involves having a set of non-arbitrary commands
> that we allow plain users to use.
> 
> Hmm.  There's an interesting thought...
> 
> How about having a "pg_filters" table in pg_catalog which allows capturing
> labels and names of known-to-be-safe binary filters:
> 
> insert into pg_filters (label, location)
> values
> ('zcat', '/usr/bin/zcat'),
> ('bzip2', '/usr/bin/bzip2'),
> ('bunzip2', '/usr/bin/bunzip2');
> 
> And then having some capability to grant permissions to roles to use
> these filters.
> 
> That's not a "version 1" capability...  Suppose we have, in 9.3, that there are
> direct references to "|/usr/bin/zcat" (and such), and then hope, in
> 9.4, to tease
> this out to be a non-superuser-capable facility via the above pg_filters?
> 
> These filters should be useful for FDWs as well as for COPY.

Well, COPY is super-user only, so it seems only useful for FDW, no?  We
already have lots of user-configuration FDW commands, so I can see
adding this one too.

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

  + It's impossible for everything to be true. +


In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2013-01-15 20:44:42
Subject: Re: count(*) of zero rows returns 1
Previous:From: Robert HaasDate: 2013-01-15 20:40:02
Subject: Re: erroneous restore into pg_catalog schema

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group