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

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: BUG #15206: Can not import CSV into PostgreSQL
Дата
Msg-id 20180520081528.laby5ezi3vhajevo@hjp.at
обсуждение исходный текст
Ответ на Re: BUG #15206: Can not import CSV into PostgreSQL  (Milorad Krstevski <miloradkrstevski@gmail.com>)
Ответы Re: BUG #15206: Can not import CSV into PostgreSQL  (Milorad Krstevski <miloradkrstevski@gmail.com>)
Список pgsql-bugs
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/>

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15080: ecpg on windows doesn't define HAVE_LONG_LONG_INT
Следующее
От: Milorad Krstevski
Дата:
Сообщение: Re: BUG #15206: Can not import CSV into PostgreSQL