RE: import question

From: "Dave Bolt" <dave(at)davebolt(dot)co(dot)uk>
To: <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: RE: import question
Date: 2020-05-26 22:39:21
Message-ID: 05c301d633ae$7fd240e0$7f76c2a0$@co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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(at)verizon(dot)net]
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
> and the version of PostgreSQL Regards Dave
>
> -----Original Message-----
> From: Scobey Weaver [mailto:scobey49(at)verizon(dot)net]
> Sent: 26 May 2020 17:54
> To: pgsql-admin(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.
>
> 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
> I can't make it work. I've also searched everywhere I could think of
> for "exit code -6"
>
> What is exit code -6?
>
> Thanks,
>
> Scobey
>
>
>
>
>
>

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2020-05-26 22:59:21 Re: import question
Previous Message David G. Johnston 2020-05-26 18:50:50 Re: PG_CRON logging