psql \copy

Started by Nonamealmost 7 years ago3 messagesgeneral
Jump to latest
#1Noname
paul.malm@lfv.se

Hi. I'm trying to execute this command:
C:\P_bin\psql -h 10.233.37.24 -p 5432 -U tester -d test -w -c "\copy public.BadenWuerttemberg_20181011 FROM C:\data\Baden-Wuerttemberg.csv' WITH DELIMITER ';' CSV"
Error: relation "public.badenwuerttemberg_20181011" does not exist.
What am I Doing wrong?

There is a table (badenwuerttemberg_20181011) in database test under the public schema. The table has all the columns, with the right types, as the csv-file.
I'm using PostgreSQL 11
Kind regards,
Paul

#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: Noname (#1)
Re: psql \copy

Hi

út 4. 6. 2019 v 10:50 odesílatel <paul.malm@lfv.se> napsal:

Hi. I’m trying to execute this command:

C:\P_bin\psql -h 10.233.37.24 -p 5432 -U tester -d test -w -c "\copy
public.BadenWuerttemberg_20181011 FROM C:\data\Baden-Wuerttemberg.csv' WITH
DELIMITER ';' CSV"

Error: relation "public.badenwuerttemberg_20181011" does not exist.

What am I Doing wrong?

looks like case sensitive identifier is used. try

"\copy public.""BadenWuerttemberg_20181011"" ...

Regards

Pavel Stehule

Show quoted text

There is a table (badenwuerttemberg_20181011) in database test under the
public schema. The table has all the columns, with the right types, as the
csv-file.

I’m using PostgreSQL 11

Kind regards,

Paul

#3Noname
paul.malm@lfv.se
In reply to: Pavel Stehule (#2)
Re: psql \copy

Thanx, it worked! :)

4 juni 2019 kl. 11:00 skrev Pavel Stehule <pavel.stehule@gmail.com<mailto:pavel.stehule@gmail.com>>:

Hi

út 4. 6. 2019 v 10:50 odesílatel <paul.malm@lfv.se<mailto:paul.malm@lfv.se>> napsal:
Hi. I’m trying to execute this command:
C:\P_bin\psql -h 10.233.37.24 -p 5432 -U tester -d test -w -c "\copy public.BadenWuerttemberg_20181011 FROM C:\data\Baden-Wuerttemberg.csv' WITH DELIMITER ';' CSV"
Error: relation "public.badenwuerttemberg_20181011" does not exist.
What am I Doing wrong?

looks like case sensitive identifier is used. try

"\copy public.""BadenWuerttemberg_20181011"" ...

Regards

Pavel Stehule

There is a table (badenwuerttemberg_20181011) in database test under the public schema. The table has all the columns, with the right types, as the csv-file.
I’m using PostgreSQL 11
Kind regards,
Paul