Re: How to use long list of columns with COPY command

From: Holger Jakobs <holger(at)jakobs(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: How to use long list of columns with COPY command
Date: 2023-06-12 21:02:12
Message-ID: 19f816a3-0e46-f02c-24b0-a6009d68dd16@jakobs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


Am 12.06.23 um 01:45 schrieb M Sarwar:
> Hi David,
> I appreciate your response.
> I tried to run COPY from SQL and I got the below error message.
>
> ERROR: COPY from a file is not supported HINT: Anyone can COPY to
> stdout or from stdin. psql's \copy command also works for anyone. SQL
> state: 0A000
>
> Here is my code:
>
> COPY bronx.TEST_GLOBAL_MCM_RAW (single_date_a, single_start_time_b,
> dual_part_m, dual_data_n ) FROM
> 'C:\Mohammed\Work\NGC\Apps\Bronx\Tables\Test_TestData_MCM\Test_TestData_MCM-LoadData\N541652_IN3799A0_CLD_ABMN.csv'
> DELIMITER ','  CSV Header ;
>
> I am trying to load the data from CSV file to the postgres database.
> Thanks,
> Sarwar
>
> ------------------------------------------------------------------------
>
>

COPY using something else than STDIN is only allowed for superusers.

COPY also uses file paths on the server, and the files have to be
readable by the system account running the server, usually postgres.

--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Nikhil Ingale 2023-06-14 10:00:50 IS JSON STRICT - In oracle => postgres ??
Previous Message Norbert Poellmann 2023-06-12 17:01:27 Re: How to use long list of columns with COPY command