RE: Import question - Mailing list pgadmin-support

From Ahmed, Nawaz (Fuji Xerox Australia)
Subject RE: Import question
Date
Msg-id SG2PR06MB220396C363A07D013BD8D768BC8E0@SG2PR06MB2203.apcprd06.prod.outlook.com
Whole thread Raw
In response to Import question  (Scobey Weaver <scobey49@verizon.net>)
Responses Re: Import question  (Aditya Toshniwal <aditya.toshniwal@enterprisedb.com>)
Re: Import question  (Scobey Weaver <scobey49@verizon.net>)
List pgadmin-support
Are you running this import into a database in Linux environment or a Windows environment ?

I am guessing (I could be wrong), it has something to do with control characters in your datafile such as ^M or ^H,
whichare usually visible if you edit the file in a Linux host using 'vi' editor.
 

And what is the import command are you using, is it a COPY command ?

~

Nawaz


-----Original Message-----
From: Scobey Weaver <scobey49@verizon.net>
Sent: Thursday, 28 May 2020 6:11 AM
To: pgadmin-support@lists.postgresql.org
Subject: Import question

I'm taking a skillshare course and creating my own tables.  I tried to import some data from a csv file and it didn't
work.I thought I had done it just like the example on the video, and also checked some other online sources which
seemedto do it the same way.
 

Attached is the file I'm trying to import.

The table I'm importing to was created as follows:

CREATE TABLE public.markets
(
     id integer NOT NULL,
     "Market" character varying(50) COLLATE pg_catalog."default" NOT NULL,
     CONSTRAINT markets_pkey PRIMARY KEY (id),
     CONSTRAINT unique_market UNIQUE ("Market")
)

TABLESPACE pg_default;

ALTER TABLE public.markets
     OWNER to postgres;
COMMENT ON TABBLE public.markets
     IS 'Market used as the price index (posted, Platts, Opis, Argus, etc...)';

The import fails with the following error:  Failed (exit code -6)

I can't find "exit code -6" anywhere.  What's wrong with my import?

I've had one reply to this that brought up encoding.  I left the encoding blank at first, as did the instructor in the
skillsharevideo. Since then I've tried the UTF8 suggested by the person who brought it up.  I also tried BIG5, EUC_CN,
SQL_ASCIIand WIN1250.
 

All efforts ended with the same result. Is there a list of exit codes anywhere?  What's "exit code -6"?

Thanks,

Scobey







IMPORTANT NOTE: Fuji Xerox email transmission, including any attachments, is private and confidential and may contain
legallyprivileged information. It is for the addressee's attention only. If you are not the intended recipient and have
receivedthis transmission, you must not use, edit, print, copy or disclose its contents to any person or disseminate
theinformation contained herein or hereto attached, and you must notify sender immediately by return email and delete
thistransmission from your system. Any confidentiality, privilege or copyright is not waived or lost because this
e-mailhas been sent to you in error. We have used reasonable efforts to protect this transmission from computer viruses
andother malicious software, but no warranty is made and the sender takes no responsibility for any loss or damage
incurredfrom using this email or the information contained in this email.
 

pgadmin-support by date:

Previous
From: Rishabh Kumar
Date:
Subject: PG Admin opens in browser
Next
From: Aditya Toshniwal
Date:
Subject: Re: Import question