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

Поиск
Список
Период
Сортировка
От Dan Kortschak
Тема `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this
Дата
Msg-id 1255392899.3427.10.camel@zoidberg.mbs.adelaide.edu.au
обсуждение исходный текст
Ответы Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this
Список pgsql-general
Hi,

I'm using the perl DBI module to interface with Pg, generating a number
of tables and then loading them into a postgres database (this is to
automate a previously psql-based setup).

One instance of loading the data looks like this, but I am only able to
do this as a superuser (this is possible for me, but I would like to
avoid it):

$dbh->do("COPY chromosome_data FROM '".chromosomes(\%options)."' CSV");

Now either I can call psql from perl (missing the point of using DBI), I
can make the user a superuser (which I would like to avoid for safety
reasons) or I can try to figure out some way of IPC to get STDOUT from
the perl to be read into postgres via STDIN (this seems unnecessarily
complicated).

Does anyone have any suggestions (the least bad of the options above
seems to be to use psql, but I think that is ugly)?

Also, can anyone suggest why it is possible to create a database but not
COPY to/from a file as a non-superuser?

thanks
Dan



В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Nested transactions
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: `must be superuser to COPY to or from a file' - using perl DBI - approaches to work around this