Обсуждение: import question

Поиск
Список
Период
Сортировка

import question

От
Scobey Weaver
Дата:
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





RE: import question

От
"Dave Bolt"
Дата:
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@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 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







RE: import question

От
"Dave Bolt"
Дата:
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
checkthe 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]
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@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
> 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
>
>
>
>
>
>





Re: import question

От
"David G. Johnston"
Дата:
On Tue, May 26, 2020 at 3:39 PM Dave Bolt <dave@davebolt.co.uk> wrote:
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.

For future reference pgAdmin is created by a third-party that provides their own support channels [1].  This mailing list, pgsql_admin, is not for questions concerning their product but rather questions pertaining to the general administration of the PostgreSQL server (even though in practice this list should be discontinued as it gets more mis-postings about pgAdmin than it does on-topic postings...).  This topic is off-topic for this list.


David J.

Re: import question

От
"David G. Johnston"
Дата:
It is customary to inline or bottom-post on these lists.

On Tue, May 26, 2020 at 3:39 PM Dave Bolt <dave@davebolt.co.uk> wrote:
Also, you should respond to the list so everyone can benefit and chip in. Everyone subscribed to the list will see the thread.

Actually its reply-all here, the OP in particular may not be subscribed and thus may not see a response sent only to the list.

David J.