Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdiEL-0000j4-CT for pgsql-admin@arkaria.postgresql.org; Tue, 26 May 2020 22:39:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jdiEJ-0002WH-V2 for pgsql-admin@arkaria.postgresql.org; Tue, 26 May 2020 22:39:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdiEJ-0002W9-Jn for pgsql-admin@lists.postgresql.org; Tue, 26 May 2020 22:39:27 +0000 Received: from nativespace-chaldene.ns-chaldene.com ([212.53.86.59]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jdiEH-0003Ke-33 for pgsql-admin@lists.postgresql.org; Tue, 26 May 2020 22:39:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=davebolt.co.uk; s=default; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-ID:Date:Subject:In-Reply-To:References:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wSvT6H6vl82yuMANZus5g8eO7kahFHCyOeQdLBXZDOI=; b=JvciOdUtMW9ukW3zmDkIwxXmvr ZBdwCa3kG/z877XQNxo4pC7RzGvTUKS8OUryIwJcptgnDxgUT6s4Ico4JC6qPnrzLDBBEb1siCOEQ N3GR6csQlWg/xL38FoqPxtD0yA8MjY6gwP2dWeaHnFLnYNm1LDnrIimY+l+JcPM20b70=; Received: from davebolt.plus.com ([80.229.145.181]:51079 helo=BELONGADAVEX) by nativespace-chaldene.ns-chaldene.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jdiEC-000VVJ-Mi for pgsql-admin@lists.postgresql.org; Tue, 26 May 2020 23:39:20 +0100 From: "Dave Bolt" To: References: <05ab01d63380$85d3a980$917afc80$@co.uk> <4bbb1f24-c85c-4f85-0156-e086ac08b560@verizon.net> In-Reply-To: <4bbb1f24-c85c-4f85-0156-e086ac08b560@verizon.net> Subject: RE: import question Date: Tue, 26 May 2020 23:39:21 +0100 Message-ID: <05c301d633ae$7fd240e0$7f76c2a0$@co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdYzn2pJEpWBOmlRSQy/e7+OwH8dnwADbXWA Content-Language: en-gb X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - nativespace-chaldene.ns-chaldene.com X-AntiAbuse: Original Domain - lists.postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - davebolt.co.uk X-Get-Message-Sender-Via: nativespace-chaldene.ns-chaldene.com: authenticated_id: dave@davebolt.co.uk X-Authenticated-Sender: nativespace-chaldene.ns-chaldene.com: dave@davebolt.co.uk List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Scobey I tried a quick and dirty test using phpPgAdmin on PostgreSQL 9.6 and it = failed, not surprised. I did get an error indicating that "1" is not a valid field name, which = was what I was half expecting. I inserted a line at the beginning of the file id,market In other words, the target field names. This time it objected to record = id 12, which is a duplicate of number 5. Deleted one of them and it worked just fine. I'm afraid I don't have immediate access to PostgreSQL 12 at the moment, = but hope this helps. (I used lower case field names in my test. I believe you have to = double-quote if you include capitals, but you should check the docs). Also, you should respond to the list so everyone can benefit and chip = in. Everyone subscribed to the list will see the thread. Regards Dave -----Original Message----- From: Scobey Weaver [mailto:scobey49@verizon.net]=20 Sent: 26 May 2020 21:51 To: Dave Bolt Subject: Re: import question Hi Dave, I'm using pgadmin 4.21 on postreSQL 12 on a macbook pro running macOS = 10.12.6. I ran it by right clicking on the table I wanted to fill and selecting = import/export to run the wizard. The file I'm uploading is attached. The table I'm importing to was created as: 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 TABLE public.markets IS 'Market used as the price index (posted, Platts, Opis, Argus, = etc...)'; I actually created it using the wizard, also, but it created this SQL = query which I'm assuming is the same. Thanks, Scobey On 5/26/20 1:10 PM, Dave Bolt wrote: > Hi Scobey > I have done imports from CSV in the past (not often), without trouble. > Can you give a little more detail of how you are running the import=20 > and the version of PostgreSQL Regards Dave > > -----Original Message----- > From: Scobey Weaver [mailto:scobey49@verizon.net] > Sent: 26 May 2020 17:54 > To: pgsql-admin@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. > > It gave the following error: Failed (exit code -6) > > I've checked what I've done and everything seems to be the same as the = > video and everything else I've found on doing an import from csv, but=20 > I can't make it work. I've also searched everywhere I could think of=20 > for "exit code -6" > > What is exit code -6? > > Thanks, > > Scobey > > > > > >