running COPY with remote DB and local file

Поиск
Список
Период
Сортировка
От Majid Azimi
Тема running COPY with remote DB and local file
Дата
Msg-id CADOhCms7AB6TNra8rc9w1MJZo=b+JUXzJR0gM=SK1f43=XKKDA@mail.gmail.com
обсуждение исходный текст
Ответы Re: running COPY with remote DB and local file  (Michael Wood <esiotrot@gmail.com>)
Список pgsql-novice
hi guys,

I'm going to run COPY from a shell script. But this script is running
on my local PC. The database is not local. Now which permission should
the output file?This is the command:

psql -U <user> -h <remote_ip> -d testdb -c "COPY (SELECT * FROM
main.data) TO /home/backup.sql WITH CSV HEADER;"

postgresql doc says:

Files named in a COPY command are read or written directly by the
server, not by the client application. Therefore, they must reside on
or be accessible to the database server machine, not the client. They
must be accessible to and readable or writable by the PostgreSQL user
(the user ID the server runs as), not the client.

I'm confused about permissions of the output when the DB is remote and
the output file is local.

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Database not browsable during COPY on PostgreSQL
Следующее
От: Majid Azimi
Дата:
Сообщение: Re: Database not browsable during COPY on PostgreSQL