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

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this
Дата
Msg-id 20091013011311.GO5407@samason.me.uk
обсуждение исходный текст
Ответ на 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>)
Список 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 по дате отправления:

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: PostgreSQL Conference West, registration closing
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this