Re: Load data from a csv file without using COPY

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Ravi Krishna <srkrishna(at)yahoo(dot)com>
Cc: PG mailing List <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Load data from a csv file without using COPY
Date: 2018-06-19 21:10:04
Message-ID: D6B45102-778D-4B35-9FB8-B007CE2A7A06@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


> On 19 Jun 2018, at 22:16, Ravi Krishna <srkrishna(at)yahoo(dot)com> wrote:
>
> In order to test a real life scenario (and use it for benchmarking) I want to load large number of data from csv files.
> The requirement is that the load should happen like an application writing to the database ( that is, no COPY command).
> Is there a tool which can do the job. Basically parse the csv file and insert it to the database row by row.
>
> thanks

I think an easy approach would be to COPY the CSV files into a separate database using psql's \copy command and then pg_dump that as separate insert statements with pg_dump —inserts.

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ravi Krishna 2018-06-19 21:14:53 Re: Load data from a csv file without using COPY
Previous Message Steve Atkins 2018-06-19 21:09:22 Re: Load data from a csv file without using COPY