Re: PostgreSQL COPY Statement Error On Linux

From: George Neuner <gneuner2(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL COPY Statement Error On Linux
Date: 2017-09-12 16:40:21
Message-ID: o23grcp82cvnjs4m6sk52d00eu8cl0mgvu@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 12 Sep 2017 11:30:02 +0100, Osahon Oduware
<osahon(dot)gis(at)gmail(dot)com> wrote:

>I am trying to utilize the "COPY" statement below to copy a .CSV file to a
>table in a PostgreSQL database.:
> *COPY <schema>.<table_name>(<table_columns>) FROM
>'\\shared\network\path\to\csv\test.csv' DELIMITER ',' CSV HEADER;*
>
>This works with a PostgreSQL database installed in a WINDOWS environment
>(Windows 7), but fails with the following error with a similar PostgreSQL
>database in a Linux environment (Centos 7):
> *org.postgresql.util.PSQLException: ERROR: could not open file
>"\\shared\network\path\to\csv\test.csv" for reading: No such file or
>directory*
>

Francisco already pointed out that Linux doesn't understand the
backslashes in the file path, however it should be noted that Windows
*does* understand forward slashes and that [modulo disk names in
Windows] you can use forward slash paths on both systems.

George

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Francisco Olarte 2017-09-12 17:43:33 Re: PostgreSQL COPY Statement Error On Linux
Previous Message Scott Marlowe 2017-09-12 16:29:16 Re: contrecord is requested