Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this
Date: 2009-10-13 01:13:11
Message-ID: 20091013011311.GO5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Oct 13, 2009 at 11:10:12AM +1030, Dan Kortschak wrote:
> On Mon, 2009-10-12 at 20:21 -0400, Stephen Frost wrote:
> > Read the 'COPY support' section.
>
> Seems like the way to go, though it will be significantly slower than
> psql or superuser reads (a couple of tables have ~10s-100sM rows).

Unless perl is doing some very funky stuff I'd expect you'll be waiting
for the disks most of the time, Perl will just be shoving blocks of data
around and this is fast. If performance is really your thing then C may
help.

> I was just wondering about the reasons for
> making that decision - the relative danger of creation and read from
> stdin vs read from a file.

"stdin" effectively just means data from the client, the filesystem
would be from "inside" the server and hence in the presence of a
malicious client letting it do stuff with its own query seems OK whereas
the server's filesystem is an authority you probably don't want to go
spreading too widely and hence is limited to userusers.

--
Sam http://samason.me.uk/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2009-10-13 01:14:11 Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this
Previous Message Dan Kortschak 2009-10-13 00:40:12 Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this