Re: The COPY command and csv files

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: The COPY command and csv files
Дата
Msg-id 18175.1145388404@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: The COPY command and csv files  ("Eric Matthew Finnin" <emf.storage@gmail.com>)
Список pgsql-novice
"Eric Matthew Finnin" <emf.storage@gmail.com> writes:
> Apparently, you can't use the COPY command to copy a whole file
> without being a super user?

You can, but not like that.  The point of the restriction is that the
database may be running on a different machine from where the user is,
and non-superusers shouldn't have access to the filesystem that the
database can see.  "COPY FROM 'filename'" is a server-side operation
and reads the server's filesystem, so it's allowed only to superusers.

However, psql (and probably most other client-side tools) have a way
to read from the client's filesystem and shove the data across the
network to a COPY FROM STDIN command.  In psql what you want is to
use the \copy command --- see the psql reference page for details.

            regards, tom lane

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

Предыдущее
От: George Young
Дата:
Сообщение: Re: Find all foreign keys and dropping them from a script.
Следующее
От: "Reza Razavipour"
Дата:
Сообщение: Maximum database size