Re: Import csv to temp table

Поиск
Список
Период
Сортировка
От Ryan Kelly
Тема Re: Import csv to temp table
Дата
Msg-id CAHUie26TGpZFhNGSTyrbABPZs0Pmpizp45GJyd-TcRuEqBFGgw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Import csv to temp table  (Paolo Saudin <paolosaudin@gmail.com>)
Список pgsql-general
I use csv2table almost every day: https://github.com/f0rk/csv2table

to just emit a create table statement: csv2table --file your_csv.csv

pipe output to psql to create.

easily used to import data as: csv2table --file your_csv.csv --copy --backslash -1 | psql your_database

use arguments like --timestamp to automagically detect types.

On Fri, Jan 5, 2024 at 12:45 AM Paolo Saudin <paolosaudin@gmail.com> wrote:
Il giorno mar 2 gen 2024 alle ore 21:17 Adrian Klaver <adrian.klaver@aklaver.com> ha scritto:
On 1/2/24 11:47, arun chirappurath wrote:

Reply to list
Ccing list
> Hi Adrian,
>
> Love this tool..however it doesn't like supporting RDS.

1) This was Daniel Vérité's suggestion not mine.

2) Define "... doesn't like supporting RDS".

a) You can generate an SQL statement without connecting to the database.
Then use that statement directly in the database.

b) If SQLAlchemy can reach the database then csvkit should be able to.

>
> https://csvkit.readthedocs.io/en/latest/
> <https://csvkit.readthedocs.io/en/latest/>
>
> Regards
> Arun
>


--
Adrian Klaver
adrian.klaver@aklaver.com


 
You can user pgloader (https://pgloader.io/) as well to load data from CSV to Postgres
Paolo 

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

Предыдущее
От: Paolo Saudin
Дата:
Сообщение: Re: Import csv to temp table
Следующее
От: Bernd Graf
Дата:
Сообщение: Filled Postgres server as Docker image