pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ravi Krishna <srkrishna@yahoo.com>
To: Alban Hertroys <haramrae@gmail.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 17:17:46 -0400
Message-ID: <B1C1D70B-F13D-4AF9-A41E-9B83F09D6328@yahoo.com> (raw)
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>

> 
> 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.
> 

This was my first thought too.  However, as I understand, pg_dump --insert basically runs INSERT INTO ... sql for every row.  
In other words, each row is un-prepared and executed individually.  That is also not real life scenario.





view thread (29+ messages)  latest in thread

Message-ID: <B1C1D70B-F13D-4AF9-A41E-9B83F09D6328@yahoo.com>
Permalink:  ../B1C1D70B-F13D-4AF9-A41E-9B83F09D6328@yahoo.com/
Also on:    postgresql.org/message-id/B1C1D70B-F13D-4AF9-A41E-9B83F09D6328@yahoo.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: srkrishna@yahoo.com, haramrae@gmail.com
  Subject: Re: Load data from a csv file without using COPY
  In-Reply-To: <B1C1D70B-F13D-4AF9-A41E-9B83F09D6328@yahoo.com>
  References: <AE89FBE5-B726-4108-925F-449E34D24651@yahoo.com> <D6B45102-778D-4B35-9FB8-B007CE2A7A06@gmail.com> <B1C1D70B-F13D-4AF9-A41E-9B83F09D6328@yahoo.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