RE: Import question

From: "Ahmed, Nawaz (Fuji Xerox Australia)" <Nawaz(dot)Ahmed(at)aus(dot)fujixerox(dot)com>
To: Scobey Weaver <scobey49(at)verizon(dot)net>, "pgadmin-support(at)lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: RE: Import question
Date: 2020-05-28 01:22:36
Message-ID: SG2PR06MB220396C363A07D013BD8D768BC8E0@SG2PR06MB2203.apcprd06.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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, which are 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(at)verizon(dot)net>
Sent: Thursday, 28 May 2020 6:11 AM
To: pgadmin-support(at)lists(dot)postgresql(dot)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 seemed to 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 skillshare video. Since then I've tried the UTF8 suggested by the person who brought it up. I also tried BIG5, EUC_CN, SQL_ASCII and 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 legally privileged information. It is for the addressee's attention only. If you are not the intended recipient and have received this transmission, you must not use, edit, print, copy or disclose its contents to any person or disseminate the information contained herein or hereto attached, and you must notify sender immediately by return email and delete this transmission from your system. Any confidentiality, privilege or copyright is not waived or lost because this e-mail has been sent to you in error. We have used reasonable efforts to protect this transmission from computer viruses and other malicious software, but no warranty is made and the sender takes no responsibility for any loss or damage incurred from using this email or the information contained in this email.

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Aditya Toshniwal 2020-05-28 04:06:29 Re: Import question
Previous Message Darren Duncan 2020-05-28 00:16:25 Re: 64bit only for Windows?