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

From Sam Mason
Subject Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this
Date
Msg-id 20091013011311.GO5407@samason.me.uk
Whole thread Raw
In response to Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this  (Dan Kortschak <dan.kortschak@adelaide.edu.au>)
List 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/

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: PostgreSQL Conference West, registration closing
Next
From: Stephen Frost
Date:
Subject: Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this