Re: copy file from a client app to remote postgres isntance

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: copy file from a client app to remote postgres isntance
Date: 2022-11-07 17:29:49
Message-ID: ad628547-cfd3-20b8-689a-08b869c5b195@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/7/22 09:57, Вадим Самохин wrote:
> 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
> <http://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 wayto copy file contents in a remote database?
There are bulk copy routines available. What is your architecture?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Willian Colognesi 2022-11-07 17:33:02 Segmentation Fault PG 14
Previous Message Вадим Самохин 2022-11-07 16:57:04 copy file from a client app to remote postgres isntance