| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера