Re: run COPY as user other than postgres

Поиск
Список
Период
Сортировка
От Jasen Betts
Тема Re: run COPY as user other than postgres
Дата
Msg-id kl8e0s$2fe$1@gonzo.reversiblemaps.ath.cx
обсуждение исходный текст
Ответ на run COPY as user other than postgres  (Kirk Wythers <wythe001@umn.edu>)
Ответы Re: run COPY as user other than postgres
Список pgsql-general
On 2013-04-23, Kirk Wythers <wythe001@umn.edu> wrote:
> 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
requiringan extra step or two) to have the postgres user own the files that I am creating with COPY TO. Here is a
simpleexample where the location '/some/path/to/file/file.csv' is owned by another user and it would be very spiffy if
Icould run the COPY TO 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;

Can you use the \copy macro in psql?



--
⚂⚃ 100% natural

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

Предыдущее
От: jesse.waters@gmail.com
Дата:
Сообщение: pgdump error "Could not open file pg_clog/0B8E: No such file or directory"
Следующее
От: Bill Moran
Дата:
Сообщение: Re: run COPY as user other than postgres