Re: BUG #15206: Can not import CSV into PostgreSQL

From: Milorad Krstevski <miloradkrstevski(at)gmail(dot)com>
To: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15206: Can not import CSV into PostgreSQL
Date: 2018-05-20 09:36:05
Message-ID: CACH_0irUZgOCJ+MQRk84u9pjDJ2OOD9O-ZmfT9=HjgfpZpzrgg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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(at)gmail(dot)com

On Sun, May 20, 2018, 10:15 Peter J. Holzer <hjp-pgsql(at)hjp(dot)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(at)hjp(dot)at | management tools.
> __/ | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavel Stehule 2018-05-20 10:20:20 Re: BUG #15206: Can not import CSV into PostgreSQL
Previous Message Peter J. Holzer 2018-05-20 08:15:28 Re: BUG #15206: Can not import CSV into PostgreSQL