BUG #15206: Can not import CSV into PostgreSQL

Started by PG Bug reporting formalmost 8 years ago19 messagesbugs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following bug has been logged on the website:

Bug reference: 15206
Logged by: Milorad Krstevski
Email address: miloradkrstevski@gmail.com
PostgreSQL version: 10.4
Operating system: Ubuntu 18.04 LTS x64
Description:

Respected,

No matter what I try, I always get the error: ERROR: extra data after last
expected column, and can not import CSV into table in PostgreSQL.

I am using pgAdmin 4.30, Python 3.6.5, Flask 0.12.2.

Can you please point out solution to my problem please?

Thank you.
Milorad K.

#2Pavel Stehule
pavel.stehule@gmail.com
In reply to: PG Bug reporting form (#1)
Re: BUG #15206: Can not import CSV into PostgreSQL

Hi

2018-05-19 11:09 GMT+02:00 PG Bug reporting form <noreply@postgresql.org>:

The following bug has been logged on the website:

Bug reference: 15206
Logged by: Milorad Krstevski
Email address: miloradkrstevski@gmail.com
PostgreSQL version: 10.4
Operating system: Ubuntu 18.04 LTS x64
Description:

Respected,

No matter what I try, I always get the error: ERROR: extra data after last
expected column, and can not import CSV into table in PostgreSQL.

I am using pgAdmin 4.30, Python 3.6.5, Flask 0.12.2.

Can you please point out solution to my problem please?

It is not PostgreSQL bug, so pg_general mailing list will be better.

PostgreSQL is very strict about CSV format - it looks so some line of CSV
doc has more columns than target table.

Regards

Pavel

Thank you.

Show quoted text

Milorad K.

#3David G. Johnston
david.g.johnston@gmail.com
In reply to: Pavel Stehule (#2)
Re: BUG #15206: Can not import CSV into PostgreSQL

On Sat, May 19, 2018 at 4:19 AM, Pavel Stehule <pavel.stehule@gmail.com>
wrote:

Hi

2018-05-19 11:09 GMT+02:00 PG Bug reporting form <noreply@postgresql.org>:

The following bug has been logged on the website:

Bug reference: 15206
Logged by: Milorad Krstevski
Email address: miloradkrstevski@gmail.com
PostgreSQL version: 10.4
Operating system: Ubuntu 18.04 LTS x64
Description:

Respected,

No matter what I try, I always get the error: ERROR: extra data after last
expected column, and can not import CSV into table in PostgreSQL.

I am using pgAdmin 4.30, Python 3.6.5, Flask 0.12.2.

Can you please point out solution to my problem please?

It is not PostgreSQL bug, so pg_general mailing list will be better.

PostgreSQL is very strict about CSV format - it looks so some line of CSV
doc has more columns than target table.

​IOW, we cannot help unless you provide both the CSV file and the table
definition.

David J.

#4Milorad Krstevski
miloradkrstevski@gmail.com
In reply to: David G. Johnston (#3)
Re: BUG #15206: Can not import CSV into PostgreSQL

Respected,

Thank you very much for the prompt reply.

I am trying to import the following files in new created empty table in
postgre db and schema (both are neptun, and the table is act):
1. s1.csv - is created manually by me (encoding UTF8 and delimiter ;) -
attachment 1
2. act2017short2.csv - is taken from system (I just put 10 lines here) -
attachment 2

The error that is shown in the import is below. I go import as CSV -
encoding UTF8 with header and delimiter ; - nothing else in the import
wizard is changed.
1. Attachment 3: Error 1
2. Attachment 4: Error 2

Can you please point me out where is my mistake? Thank you.

Respectfully,
Milorad K.

On Sat, May 19, 2018 at 2:55 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

On Sat, May 19, 2018 at 4:19 AM, Pavel Stehule <pavel.stehule@gmail.com>
wrote:

Hi

2018-05-19 11:09 GMT+02:00 PG Bug reporting form <noreply@postgresql.org>
:

The following bug has been logged on the website:

Bug reference: 15206
Logged by: Milorad Krstevski
Email address: miloradkrstevski@gmail.com
PostgreSQL version: 10.4
Operating system: Ubuntu 18.04 LTS x64
Description:

Respected,

No matter what I try, I always get the error: ERROR: extra data after
last
expected column, and can not import CSV into table in PostgreSQL.

I am using pgAdmin 4.30, Python 3.6.5, Flask 0.12.2.

Can you please point out solution to my problem please?

It is not PostgreSQL bug, so pg_general mailing list will be better.

PostgreSQL is very strict about CSV format - it looks so some line of CSV
doc has more columns than target table.

​IOW, we cannot help unless you provide both the CSV file and the table
definition.

David J.

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

Attachments:

s1.csvtext/csv; charset=US-ASCII; name=s1.csvDownload
act2017short2.csvtext/csv; charset=US-ASCII; name=act2017short2.csvDownload
error1.PNGimage/png; name=error1.PNGDownload
error2.PNGimage/png; name=error2.PNGDownload
#5David G. Johnston
david.g.johnston@gmail.com
In reply to: Milorad Krstevski (#4)
Re: BUG #15206: Can not import CSV into PostgreSQL

On Sat, May 19, 2018 at 6:57 AM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Can you please point me out where is my mistake? Thank you

​Given you still haven't provided the definition of ​"neptun.act" that
would be a no.

David J.

#6Milorad Krstevski
miloradkrstevski@gmail.com
In reply to: David G. Johnston (#5)
Re: BUG #15206: Can not import CSV into PostgreSQL

Can you please help me how to do that?

The table is empty new, nothing pre-set?

On Sat, May 19, 2018 at 4:03 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

On Sat, May 19, 2018 at 6:57 AM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Can you please point me out where is my mistake? Thank you

​Given you still haven't provided the definition of ​"neptun.act" that
would be a no.

David J.

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

#7Milorad Krstevski
miloradkrstevski@gmail.com
In reply to: Milorad Krstevski (#4)
Re: BUG #15206: Can not import CSV into PostgreSQL

Here is the backup of the whole db.

It is empty. The pass is: miki (in case you need it).

On Sat, May 19, 2018 at 3:57 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Respected,

Thank you very much for the prompt reply.

I am trying to import the following files in new created empty table in
postgre db and schema (both are neptun, and the table is act):
1. s1.csv - is created manually by me (encoding UTF8 and delimiter ;) -
attachment 1
2. act2017short2.csv - is taken from system (I just put 10 lines here) -
attachment 2

The error that is shown in the import is below. I go import as CSV -
encoding UTF8 with header and delimiter ; - nothing else in the import
wizard is changed.
1. Attachment 3: Error 1
2. Attachment 4: Error 2

Can you please point me out where is my mistake? Thank you.

Respectfully,
Milorad K.

On Sat, May 19, 2018 at 2:55 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

On Sat, May 19, 2018 at 4:19 AM, Pavel Stehule <pavel.stehule@gmail.com>
wrote:

Hi

2018-05-19 11:09 GMT+02:00 PG Bug reporting form <noreply@postgresql.org

:

The following bug has been logged on the website:

Bug reference: 15206
Logged by: Milorad Krstevski
Email address: miloradkrstevski@gmail.com
PostgreSQL version: 10.4
Operating system: Ubuntu 18.04 LTS x64
Description:

Respected,

No matter what I try, I always get the error: ERROR: extra data after
last
expected column, and can not import CSV into table in PostgreSQL.

I am using pgAdmin 4.30, Python 3.6.5, Flask 0.12.2.

Can you please point out solution to my problem please?

It is not PostgreSQL bug, so pg_general mailing list will be better.

PostgreSQL is very strict about CSV format - it looks so some line of
CSV doc has more columns than target table.

​IOW, we cannot help unless you provide both the CSV file and the table
definition.

David J.

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

Attachments:

backup_dbapplication/octet-stream; name=backup_dbDownload
#8Milorad Krstevski
miloradkrstevski@gmail.com
In reply to: Milorad Krstevski (#7)
Re: BUG #15206: Can not import CSV into PostgreSQL

Is this OK?

Please let me know. Thank you.

On Sat, May 19, 2018 at 4:14 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Here is the backup of the whole db.

It is empty. The pass is: miki (in case you need it).

On Sat, May 19, 2018 at 3:57 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Respected,

Thank you very much for the prompt reply.

I am trying to import the following files in new created empty table in
postgre db and schema (both are neptun, and the table is act):
1. s1.csv - is created manually by me (encoding UTF8 and delimiter ;) -
attachment 1
2. act2017short2.csv - is taken from system (I just put 10 lines here) -
attachment 2

The error that is shown in the import is below. I go import as CSV -
encoding UTF8 with header and delimiter ; - nothing else in the import
wizard is changed.
1. Attachment 3: Error 1
2. Attachment 4: Error 2

Can you please point me out where is my mistake? Thank you.

Respectfully,
Milorad K.

On Sat, May 19, 2018 at 2:55 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

On Sat, May 19, 2018 at 4:19 AM, Pavel Stehule <pavel.stehule@gmail.com>
wrote:

Hi

2018-05-19 11:09 GMT+02:00 PG Bug reporting form <
noreply@postgresql.org>:

The following bug has been logged on the website:

Bug reference: 15206
Logged by: Milorad Krstevski
Email address: miloradkrstevski@gmail.com
PostgreSQL version: 10.4
Operating system: Ubuntu 18.04 LTS x64
Description:

Respected,

No matter what I try, I always get the error: ERROR: extra data after
last
expected column, and can not import CSV into table in PostgreSQL.

I am using pgAdmin 4.30, Python 3.6.5, Flask 0.12.2.

Can you please point out solution to my problem please?

It is not PostgreSQL bug, so pg_general mailing list will be better.

PostgreSQL is very strict about CSV format - it looks so some line of
CSV doc has more columns than target table.

​IOW, we cannot help unless you provide both the CSV file and the table
definition.

David J.

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

#9David G. Johnston
david.g.johnston@gmail.com
In reply to: Milorad Krstevski (#8)
Re: BUG #15206: Can not import CSV into PostgreSQL

A screenshot would be better for me, dealing with a dump file is too
high-maintenance for this kind of question.

On Sat, May 19, 2018 at 7:18 AM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Show quoted text

Is this OK?

Please let me know. Thank you.

On Sat, May 19, 2018 at 4:14 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Here is the backup of the whole db.

It is empty. The pass is: miki (in case you need it).

On Sat, May 19, 2018 at 3:57 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Respected,

Thank you very much for the prompt reply.

I am trying to import the following files in new created empty table in
postgre db and schema (both are neptun, and the table is act):
1. s1.csv - is created manually by me (encoding UTF8 and delimiter ;) -
attachment 1
2. act2017short2.csv - is taken from system (I just put 10 lines here) -
attachment 2

The error that is shown in the import is below. I go import as CSV -
encoding UTF8 with header and delimiter ; - nothing else in the import
wizard is changed.
1. Attachment 3: Error 1
2. Attachment 4: Error 2

Can you please point me out where is my mistake? Thank you.

Respectfully,
Milorad K.

On Sat, May 19, 2018 at 2:55 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

On Sat, May 19, 2018 at 4:19 AM, Pavel Stehule <pavel.stehule@gmail.com

wrote:

Hi

2018-05-19 11:09 GMT+02:00 PG Bug reporting form <
noreply@postgresql.org>:

The following bug has been logged on the website:

Bug reference: 15206
Logged by: Milorad Krstevski
Email address: miloradkrstevski@gmail.com
PostgreSQL version: 10.4
Operating system: Ubuntu 18.04 LTS x64
Description:

Respected,

No matter what I try, I always get the error: ERROR: extra data after
last
expected column, and can not import CSV into table in PostgreSQL.

I am using pgAdmin 4.30, Python 3.6.5, Flask 0.12.2.

Can you please point out solution to my problem please?

It is not PostgreSQL bug, so pg_general mailing list will be better.

PostgreSQL is very strict about CSV format - it looks so some line of
CSV doc has more columns than target table.

​IOW, we cannot help unless you provide both the CSV file and the table
definition.

David J.

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

#10Milorad Krstevski
miloradkrstevski@gmail.com
In reply to: David G. Johnston (#9)
Re: BUG #15206: Can not import CSV into PostgreSQL

Screenshot of what?

I will take now but please point me out.

On Sat, May 19, 2018 at 4:24 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

A screenshot would be better for me, dealing with a dump file is too
high-maintenance for this kind of question.

On Sat, May 19, 2018 at 7:18 AM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Is this OK?

Please let me know. Thank you.

On Sat, May 19, 2018 at 4:14 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Here is the backup of the whole db.

It is empty. The pass is: miki (in case you need it).

On Sat, May 19, 2018 at 3:57 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Respected,

Thank you very much for the prompt reply.

I am trying to import the following files in new created empty table in
postgre db and schema (both are neptun, and the table is act):
1. s1.csv - is created manually by me (encoding UTF8 and delimiter ;) -
attachment 1
2. act2017short2.csv - is taken from system (I just put 10 lines here)
- attachment 2

The error that is shown in the import is below. I go import as CSV -
encoding UTF8 with header and delimiter ; - nothing else in the import
wizard is changed.
1. Attachment 3: Error 1
2. Attachment 4: Error 2

Can you please point me out where is my mistake? Thank you.

Respectfully,
Milorad K.

On Sat, May 19, 2018 at 2:55 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

On Sat, May 19, 2018 at 4:19 AM, Pavel Stehule <
pavel.stehule@gmail.com> wrote:

Hi

2018-05-19 11:09 GMT+02:00 PG Bug reporting form <
noreply@postgresql.org>:

The following bug has been logged on the website:

Bug reference: 15206
Logged by: Milorad Krstevski
Email address: miloradkrstevski@gmail.com
PostgreSQL version: 10.4
Operating system: Ubuntu 18.04 LTS x64
Description:

Respected,

No matter what I try, I always get the error: ERROR: extra data
after last
expected column, and can not import CSV into table in PostgreSQL.

I am using pgAdmin 4.30, Python 3.6.5, Flask 0.12.2.

Can you please point out solution to my problem please?

It is not PostgreSQL bug, so pg_general mailing list will be better.

PostgreSQL is very strict about CSV format - it looks so some line of
CSV doc has more columns than target table.

​IOW, we cannot help unless you provide both the CSV file and the
table definition.

David J.

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

#11David G. Johnston
david.g.johnston@gmail.com
In reply to: Milorad Krstevski (#10)
Re: BUG #15206: Can not import CSV into PostgreSQL

The definition of the neptune.act table. The pgAdmin docs can walk you
through how to go about finding that if you cannot intuit how to navigate
the object browser it provides.

You need to count how many columns are on that table and compare them to
how many are in the csv file. You should find there are fewer in the table
which means you need to fix the table. If you find the counts to be the
same then it might be something different.

Dave

On Sat, May 19, 2018 at 7:25 AM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Show quoted text

Screenshot of what?

I will take now but please point me out.

On Sat, May 19, 2018 at 4:24 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

A screenshot would be better for me, dealing with a dump file is too
high-maintenance for this kind of question.

On Sat, May 19, 2018 at 7:18 AM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Is this OK?

Please let me know. Thank you.

On Sat, May 19, 2018 at 4:14 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Here is the backup of the whole db.

It is empty. The pass is: miki (in case you need it).

On Sat, May 19, 2018 at 3:57 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Respected,

Thank you very much for the prompt reply.

I am trying to import the following files in new created empty table
in postgre db and schema (both are neptun, and the table is act):
1. s1.csv - is created manually by me (encoding UTF8 and delimiter ;)
- attachment 1
2. act2017short2.csv - is taken from system (I just put 10 lines here)
- attachment 2

The error that is shown in the import is below. I go import as CSV -
encoding UTF8 with header and delimiter ; - nothing else in the import
wizard is changed.
1. Attachment 3: Error 1
2. Attachment 4: Error 2

Can you please point me out where is my mistake? Thank you.

Respectfully,
Milorad K.

On Sat, May 19, 2018 at 2:55 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

On Sat, May 19, 2018 at 4:19 AM, Pavel Stehule <
pavel.stehule@gmail.com> wrote:

Hi

2018-05-19 11:09 GMT+02:00 PG Bug reporting form <
noreply@postgresql.org>:

The following bug has been logged on the website:

Bug reference: 15206
Logged by: Milorad Krstevski
Email address: miloradkrstevski@gmail.com
PostgreSQL version: 10.4
Operating system: Ubuntu 18.04 LTS x64
Description:

Respected,

No matter what I try, I always get the error: ERROR: extra data
after last
expected column, and can not import CSV into table in PostgreSQL.

I am using pgAdmin 4.30, Python 3.6.5, Flask 0.12.2.

Can you please point out solution to my problem please?

It is not PostgreSQL bug, so pg_general mailing list will be better.

PostgreSQL is very strict about CSV format - it looks so some line
of CSV doc has more columns than target table.

​IOW, we cannot help unless you provide both the CSV file and the
table definition.

David J.

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

#12Milorad Krstevski
miloradkrstevski@gmail.com
In reply to: David G. Johnston (#11)
Re: BUG #15206: Can not import CSV into PostgreSQL

Please find in attach the backup schema.

I really do not know how to export the settings (or what is needed to you).
If you could please send me screen of what is needed?

I created all db, schema and table empty with default settings. Nothing is
changed or limited. I put postgre user with all privileges everywhere.
That's it. Nothing else.

On Sat, May 19, 2018 at 4:31 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

The definition of the neptune.act table. The pgAdmin docs can walk you
through how to go about finding that if you cannot intuit how to navigate
the object browser it provides.

You need to count how many columns are on that table and compare them to
how many are in the csv file. You should find there are fewer in the table
which means you need to fix the table. If you find the counts to be the
same then it might be something different.

Dave

On Sat, May 19, 2018 at 7:25 AM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Screenshot of what?

I will take now but please point me out.

On Sat, May 19, 2018 at 4:24 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

A screenshot would be better for me, dealing with a dump file is too
high-maintenance for this kind of question.

On Sat, May 19, 2018 at 7:18 AM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Is this OK?

Please let me know. Thank you.

On Sat, May 19, 2018 at 4:14 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Here is the backup of the whole db.

It is empty. The pass is: miki (in case you need it).

On Sat, May 19, 2018 at 3:57 PM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

Respected,

Thank you very much for the prompt reply.

I am trying to import the following files in new created empty table
in postgre db and schema (both are neptun, and the table is act):
1. s1.csv - is created manually by me (encoding UTF8 and delimiter ;)
- attachment 1
2. act2017short2.csv - is taken from system (I just put 10 lines
here) - attachment 2

The error that is shown in the import is below. I go import as CSV -
encoding UTF8 with header and delimiter ; - nothing else in the import
wizard is changed.
1. Attachment 3: Error 1
2. Attachment 4: Error 2

Can you please point me out where is my mistake? Thank you.

Respectfully,
Milorad K.

On Sat, May 19, 2018 at 2:55 PM, David G. Johnston <
david.g.johnston@gmail.com> wrote:

On Sat, May 19, 2018 at 4:19 AM, Pavel Stehule <
pavel.stehule@gmail.com> wrote:

Hi

2018-05-19 11:09 GMT+02:00 PG Bug reporting form <
noreply@postgresql.org>:

The following bug has been logged on the website:

Bug reference: 15206
Logged by: Milorad Krstevski
Email address: miloradkrstevski@gmail.com
PostgreSQL version: 10.4
Operating system: Ubuntu 18.04 LTS x64
Description:

Respected,

No matter what I try, I always get the error: ERROR: extra data
after last
expected column, and can not import CSV into table in PostgreSQL.

I am using pgAdmin 4.30, Python 3.6.5, Flask 0.12.2.

Can you please point out solution to my problem please?

It is not PostgreSQL bug, so pg_general mailing list will be better.

PostgreSQL is very strict about CSV format - it looks so some line
of CSV doc has more columns than target table.

​IOW, we cannot help unless you provide both the CSV file and the
table definition.

David J.

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

Attachments:

schema_backupapplication/octet-stream; name=schema_backupDownload
#13Andrew Gierth
andrew@tao11.riddles.org.uk
In reply to: Milorad Krstevski (#12)
Re: BUG #15206: Can not import CSV into PostgreSQL

"Milorad" == Milorad Krstevski <miloradkrstevski@gmail.com> writes:

Milorad> I created all db, schema and table empty with default
Milorad> settings.

The problem is that your table is "empty" in the sense of having NO
COLUMNS AT ALL. So obviously you can't copy data into it.

(Tables with no columns are not useful, and should never be created
intentionally.)

This isn't a bug, and you should never have posted it to the bug
reporting form in the first place. There are places to ask for help,
such as the pgsql-general or pgsql-novice mailing lists or the IRC
channel (#postgresql on freenode.net).

--
Andrew (irc:RhodiumToad)

#14Milorad Krstevski
miloradkrstevski@gmail.com
In reply to: Andrew Gierth (#13)
Re: BUG #15206: Can not import CSV into PostgreSQL

So first I have to create all (for example 50 columns and define them in
data type) and then import? That is not the case with any other db.

I tested as you said, first to create 3x columns, import and it went well
(att. example 1). Please see the screenshot.

BTW, how can I bulk import many columns? Is it possible via SQL query or
another way is better?

Sorry for the wrong mailing list and the "bug classification" but I am new
in PostgreSQL and want it to connect to an app.

On Sat, May 19, 2018 at 4:53 PM, Andrew Gierth <andrew@tao11.riddles.org.uk>
wrote:

"Milorad" == Milorad Krstevski <miloradkrstevski@gmail.com> writes:

Milorad> I created all db, schema and table empty with default
Milorad> settings.

The problem is that your table is "empty" in the sense of having NO
COLUMNS AT ALL. So obviously you can't copy data into it.

(Tables with no columns are not useful, and should never be created
intentionally.)

This isn't a bug, and you should never have posted it to the bug
reporting form in the first place. There are places to ask for help,
such as the pgsql-general or pgsql-novice mailing lists or the IRC
channel (#postgresql on freenode.net).

--
Andrew (irc:RhodiumToad)

--
Milorad Krstevski

Mobile: +389 71 381 168
E-mail: miloradkrstevski@gmail.com

Attachments:

example1.PNGimage/png; name=example1.PNGDownload
#15David G. Johnston
david.g.johnston@gmail.com
In reply to: Milorad Krstevski (#14)
Re: BUG #15206: Can not import CSV into PostgreSQL

On Sat, May 19, 2018 at 8:05 AM, Milorad Krstevski <
miloradkrstevski@gmail.com> wrote:

So first I have to create all (for example 50 columns and define them in
data type) and then import? That is not the case with any other db.

​Cannot speak about others but stock PostgreSQL, yes.

Haven't used it but the following seems relevant if you are looking for a
tool to make life easier:

http://csvkit.readthedocs.io/en/1.0.3/tutorial/3_power_tools.html#csvsql-and-sql2csv-ultimate-power

David J.

#16Peter J. Holzer
hjp-pgsql@hjp.at
In reply to: Milorad Krstevski (#14)
Re: BUG #15206: Can not import CSV into PostgreSQL

On 2018-05-19 17:05:42 +0200, Milorad Krstevski wrote:

So first I have to create all (for example 50 columns and define them in data
type) and then import? That is not the case with any other db.

I am quite certain that it is also the case for Oracle and MySQL.

I suspect that it is true for all SQL databases, since SQL distinguishes
between data definition (DDL) and data manipulation (DML) statements.
Loading data into a table is data manipulation, and you don't want that
to change your data definition as a side effect.

Which database can automatically create columns while loading a CSV file
into a table?

(It is of course possible to write a program which guesses the types of
the columns from the contents of the CSV file and then issues an
appropriate CREATE TABLE or ALTER TABLE statement. I wrote one 20 years
ago. But that's an application program, not part of the database.)

hp

--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp@hjp.at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/&gt;

#17Milorad Krstevski
miloradkrstevski@gmail.com
In reply to: Peter J. Holzer (#16)
Re: BUG #15206: Can not import CSV into PostgreSQL

Thank you for all the prompt replies and explanations about databases. I am
a little new in this, so maybe I made some conclusions not quite right.

I was hoping that you can help me with issues like importing sql dumps from
other sources (mssql and mysql), because I wanna migrate into postgre, and
also how to import DDL from other tables into postgre and afterwards import
the CSV files. Having them created manually is quite long.

---
Milorad Krstevski
M: +389 71 381 168
E: miloradkrstevski@gmail.com

On Sun, May 20, 2018, 10:15 Peter J. Holzer <hjp-pgsql@hjp.at> wrote:

Show quoted text

On 2018-05-19 17:05:42 +0200, Milorad Krstevski wrote:

So first I have to create all (for example 50 columns and define them in

data

type) and then import? That is not the case with any other db.

I am quite certain that it is also the case for Oracle and MySQL.

I suspect that it is true for all SQL databases, since SQL distinguishes
between data definition (DDL) and data manipulation (DML) statements.
Loading data into a table is data manipulation, and you don't want that
to change your data definition as a side effect.

Which database can automatically create columns while loading a CSV file
into a table?

(It is of course possible to write a program which guesses the types of
the columns from the contents of the CSV file and then issues an
appropriate CREATE TABLE or ALTER TABLE statement. I wrote one 20 years
ago. But that's an application program, not part of the database.)

hp

--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp@hjp.at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/&gt;

#18Pavel Stehule
pavel.stehule@gmail.com
In reply to: Milorad Krstevski (#17)
Re: BUG #15206: Can not import CSV into PostgreSQL

2018-05-20 11:36 GMT+02:00 Milorad Krstevski <miloradkrstevski@gmail.com>:

Thank you for all the prompt replies and explanations about databases. I
am a little new in this, so maybe I made some conclusions not quite right.

I was hoping that you can help me with issues like importing sql dumps
from other sources (mssql and mysql), because I wanna migrate into postgre,
and also how to import DDL from other tables into postgre and afterwards
import the CSV files. Having them created manually is quite long.

Ora2pg supports migration from mysql too now.

https://github.com/darold/ora2pg

Regards

Pavel Stehule

Show quoted text

---
Milorad Krstevski
M: +389 71 381 168
E: miloradkrstevski@gmail.com

On Sun, May 20, 2018, 10:15 Peter J. Holzer <hjp-pgsql@hjp.at> wrote:

On 2018-05-19 17:05:42 +0200, Milorad Krstevski wrote:

So first I have to create all (for example 50 columns and define them

in data

type) and then import? That is not the case with any other db.

I am quite certain that it is also the case for Oracle and MySQL.

I suspect that it is true for all SQL databases, since SQL distinguishes
between data definition (DDL) and data manipulation (DML) statements.
Loading data into a table is data manipulation, and you don't want that
to change your data definition as a side effect.

Which database can automatically create columns while loading a CSV file
into a table?

(It is of course possible to write a program which guesses the types of
the columns from the contents of the CSV file and then issues an
appropriate CREATE TABLE or ALTER TABLE statement. I wrote one 20 years
ago. But that's an application program, not part of the database.)

hp

--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp@hjp.at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/&gt;

#19Milorad Krstevski
miloradkrstevski@gmail.com
In reply to: Pavel Stehule (#18)
Re: BUG #15206: Can not import CSV into PostgreSQL

Thanks, I'll check it out.

---
Milorad Krstevski
M: +389 71 381 168
E: miloradkrstevski@gmail.com

On Sun, May 20, 2018, 12:21 Pavel Stehule <pavel.stehule@gmail.com> wrote:

Show quoted text

2018-05-20 11:36 GMT+02:00 Milorad Krstevski <miloradkrstevski@gmail.com>:

Thank you for all the prompt replies and explanations about databases. I
am a little new in this, so maybe I made some conclusions not quite right.

I was hoping that you can help me with issues like importing sql dumps
from other sources (mssql and mysql), because I wanna migrate into postgre,
and also how to import DDL from other tables into postgre and afterwards
import the CSV files. Having them created manually is quite long.

Ora2pg supports migration from mysql too now.

https://github.com/darold/ora2pg

Regards

Pavel Stehule

---
Milorad Krstevski
M: +389 71 381 168
E: miloradkrstevski@gmail.com

On Sun, May 20, 2018, 10:15 Peter J. Holzer <hjp-pgsql@hjp.at> wrote:

On 2018-05-19 17:05:42 +0200, Milorad Krstevski wrote:

So first I have to create all (for example 50 columns and define them

in data

type) and then import? That is not the case with any other db.

I am quite certain that it is also the case for Oracle and MySQL.

I suspect that it is true for all SQL databases, since SQL distinguishes
between data definition (DDL) and data manipulation (DML) statements.
Loading data into a table is data manipulation, and you don't want that
to change your data definition as a side effect.

Which database can automatically create columns while loading a CSV file
into a table?

(It is of course possible to write a program which guesses the types of
the columns from the contents of the CSV file and then issues an
appropriate CREATE TABLE or ALTER TABLE statement. I wrote one 20 years
ago. But that's an application program, not part of the database.)

hp

--
_ | Peter J. Holzer | we build much bigger, better disasters now
|_|_) | | because we have much more sophisticated
| | | hjp@hjp.at | management tools.
__/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/&gt;