Re: Import csv to temp table

2024-01-04 Thread Ryan Kelly
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

Re: Import csv to temp table

2024-01-04 Thread Paolo Saudin
Il giorno mar 2 gen 2024 alle ore 21:17 Adrian Klaver < adrian.kla...@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

Re: Import csv to temp table

2024-01-02 Thread Adrian Klaver
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

Re: Import csv to temp table

2024-01-02 Thread Adrian Klaver
On 1/2/24 06:51, Daniel Verite wrote: arun chirappurath wrote: Do we have any scripts that create a temp table with column names from the first row of csv files? csvkit [1] does that. [1] https://csvkit.readthedocs.io/en/latest/ In addition to the above which I have used you might

Re: Import csv to temp table

2024-01-02 Thread Daniel Verite
arun chirappurath wrote: > Do we have any scripts that create a temp table with column names > from the first row of csv files? csvkit [1] does that. [1] https://csvkit.readthedocs.io/en/latest/ Best regards, -- Daniel Vérité https://postgresql.verite.pro/ Twitter: @DanielVerite

Re: Import csv to temp table

2024-01-02 Thread Ron Johnson
On Tue, Jan 2, 2024 at 7:02 AM arun chirappurath wrote: > Dear All, > > Do we have any scripts that create a temp table with column names from the > first row of csv files? > How would you determine the data type? If you assume TEXT for all of them, then it's relatively simple to write bash

Import csv to temp table

2024-01-02 Thread arun chirappurath
Dear All, Do we have any scripts that create a temp table with column names from the first row of csv files? any functions which we can pass the file name as parameter which loads the data to csv based on the data Thanks, ACDBA