Piping CSV data to psql when executing COPY .. FROM STDIN
В списке pgsql-general по дате отправления:
| От | Allan Kamau |
|---|---|
| Тема | Piping CSV data to psql when executing COPY .. FROM STDIN |
| Дата | |
| Msg-id | 4906F68C.90502@sanbi.ac.za обсуждение исходный текст |
| Ответы |
Re: Piping CSV data to psql when executing COPY .. FROM STDIN
|
| Список | pgsql-general |
Hi all, I am trying to copy data (results of a SELECT * FROM abc WHERE ...) to a remote PC (on my network). If I execute the "COPY abc2 FROM abc.txt CSV WITH HEADER" on psql connected to the remote PC, PostgreSQL will expect the file to be resident on the (remote) server's file system (or atleast accessible via it's file system). This would require me to configure password less scp for a given OS user account between the two PC. Then have a script send the csv file to the remote server before I call the COPY command. Am trying to avoid this step. The alternative I am attempting is to use "COPY abc FROM STDIN WITH HEADER". I pipe the contents of the CSV file on my PC to the psql command (that connects to the remote PC) while issuing this copy command. This does seems not to work. Is there a way around it. Allan.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера