Re: Load a csv to remote postgresql database

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: priyanka raghav <priyankarag(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Load a csv to remote postgresql database
Date: 2017-03-02 06:08:06
Message-ID: CAFj8pRBSHAkUVOYhRYKTFOSyxMCrrqevv5xFZu0jSMhG4zB4+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

2017-03-02 7:01 GMT+01:00 priyanka raghav <priyankarag(at)gmail(dot)com>:

> Hi,
>
> I am trying to load a csv file of approx 500mb to remote postgres
> database. Earlier when the app server and db server were co-located,
> COPY command was working fine but ever since the db server is moved to
> a different box, the command is failing. I understand that COPY
> command searches the file on database server which it is not able to
> find and hence is throwing an error. I cannot use /COPY as it is a
> psql command. What options do I have to go about this. I need an
> urgent answer to this. Thanks in advance.
>

The psql COPY is special case for server side COPY.

if you cannot to use a psql \copy, then you have to use a special API for
you programming language that can to create a bridge between client and
server.

Why you cannot to use psql \copy ?

Regards

Pavel

>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2017-03-02 06:34:49 Re: Load a csv to remote postgresql database
Previous Message priyanka raghav 2017-03-02 06:01:01 Load a csv to remote postgresql database