copy file from a client app to remote postgres isntance

Поиск
Список
Период
Сортировка
От Вадим Самохин
Тема copy file from a client app to remote postgres isntance
Дата
Msg-id CAGVmuwoKkos2ssA7-MNpsQkxO=0ouOGS9PtqzFViJ2+0SDeXkQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: copy file from a client app to remote postgres isntance  (Rob Sargent <robjsargent@gmail.com>)
Re: copy file from a client app to remote postgres isntance  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: copy file from a client app to remote postgres isntance  (Ron <ronljohnsonjr@gmail.com>)
Re: copy file from a client app to remote postgres isntance  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Список pgsql-general
Hi all,
I have an application that must copy a local file in csv format to a postgres table on a remote host. The closest solution is this one (https://stackoverflow.com/a/9327519/618020). It boils down to specifying a \copy meta-command in a psql command:
psql -U %s -p %s -d %s -f - <<EOT\n here hoes a \copy meta-command \nEOT\n

and executing it. B
ut it's quite an unnatural way to write database code. Has anything changed in the last ten years? Or, is there a better way to copy file contents in a remote database?

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

Предыдущее
От: Sascha Zenglein
Дата:
Сообщение: AW: AW: Reducing bandwidth usage of database replication
Следующее
От: Rob Sargent
Дата:
Сообщение: Re: copy file from a client app to remote postgres isntance