From: | Ryan Kelly <rpkelly22(at)gmail(dot)com> |
---|---|
To: | Paolo Saudin <paolosaudin(at)gmail(dot)com> |
Cc: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, arun chirappurath <arunsnmimt(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Import csv to temp table |
Date: | 2024-01-05 06:02:37 |
Message-ID: | CAHUie26TGpZFhNGSTyrbABPZs0Pmpizp45GJyd-TcRuEqBFGgw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)gmail(dot)com> wrote:
> Il giorno mar 2 gen 2024 alle ore 21:17 Adrian Klaver <
> adrian(dot)klaver(at)aklaver(dot)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(dot)klaver(at)aklaver(dot)com
>>
>>
>>
> You can user pgloader (https://pgloader.io/) as well to load data from
> CSV to Postgres
> Paolo
>
From | Date | Subject | |
---|---|---|---|
Next Message | Bernd Graf | 2024-01-05 10:31:34 | Filled Postgres server as Docker image |
Previous Message | Paolo Saudin | 2024-01-05 05:44:32 | Re: Import csv to temp table |