pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alban Hertroys <haramrae@gmail.com>
To: Ravi Krishna <srkrishna@yahoo.com>
Cc: PG mailing List <pgsql-general@lists.postgresql.org>
Subject: Re: Load data from a csv file without using COPY
Date: Tue, 19 Jun 2018 23:10:04 +0200
Message-ID: <D6B45102-778D-4B35-9FB8-B007CE2A7A06@gmail.com> (raw)
In-Reply-To: <AE89FBE5-B726-4108-925F-449E34D24651@yahoo.com>
References: <AE89FBE5-B726-4108-925F-449E34D24651@yahoo.com>


> On 19 Jun 2018, at 22:16, Ravi Krishna <srkrishna@yahoo.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.





view thread (29+ messages)  latest in thread

Message-ID: <D6B45102-778D-4B35-9FB8-B007CE2A7A06@gmail.com>
Permalink:  ../D6B45102-778D-4B35-9FB8-B007CE2A7A06@gmail.com/
Also on:    postgresql.org/message-id/D6B45102-778D-4B35-9FB8-B007CE2A7A06@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: haramrae@gmail.com, srkrishna@yahoo.com
  Subject: Re: Load data from a csv file without using COPY
  In-Reply-To: <D6B45102-778D-4B35-9FB8-B007CE2A7A06@gmail.com>
  References: <AE89FBE5-B726-4108-925F-449E34D24651@yahoo.com> <D6B45102-778D-4B35-9FB8-B007CE2A7A06@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox