run COPY as user other than postgres

Поиск
Список
Период
Сортировка
От Kirk Wythers
Тема run COPY as user other than postgres
Дата
Msg-id A58A7CEC-6F60-4ADB-AC88-655DCBC10123@gmail.com
обсуждение исходный текст
Ответы Re: run COPY as user other than postgres
Re: run COPY as user other than postgres
Список pgsql-general
I would like to run the COPY command as a user other than "postgres". I find it a bit of a pain (or at least requiring
anextra step or two) to have the postgres user own the files that I am creating with COPY TO. Here is a simple example
wherethe location '/some/path/to/file/file.csv' is owned by another user and it would be very spiffy if I could run the
COPYTO as that user. Any ideas?  



COPY (
    SELECT * FROM
        some_table
    WHERE
        2012 = EXTRACT (YEAR FROM some_column) --AND value IS NOT NULL
)
    TO '/some/path/to/file/file.csv' WITH CSV HEADER;

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

Предыдущее
От: François Beausoleil
Дата:
Сообщение: Re: pg_stop_backup running for 2h10m?
Следующее
От: Ryan Kelly
Дата:
Сообщение: Re: run COPY as user other than postgres