Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVO0q-0006uf-1Q for pgsql-general@arkaria.postgresql.org; Tue, 19 Jun 2018 21:18:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fVO0o-0003lQ-BS for pgsql-general@arkaria.postgresql.org; Tue, 19 Jun 2018 21:18:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVO0o-0003lG-3J for pgsql-general@lists.postgresql.org; Tue, 19 Jun 2018 21:18:02 +0000 Received: from sonic301-32.consmr.mail.ne1.yahoo.com ([66.163.184.201]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVO0l-0005Jt-K3 for pgsql-general@lists.postgresql.org; Tue, 19 Jun 2018 21:18:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1529443076; bh=OSpOPsYXiyQy6CJgmEZcs5uOWPrDWaFxtQTSvtTrqYA=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=WAByesKH1dVnliehKLxli7gfD+tYSL/4vVMLJMoMW+lGqmjbh/0fIaLFBykgxe4d/krd98ppbHz2YT8D0kfVcZSqTTWEvna2l6wfa4mWkxEFH64yzux0waI7OBKp57Ng4JWIjCSBRdhj5nSBIxWprcI6OHKAC+Rgj3fGfoTZmOkW0YJoSF9VBwqQMY01uMVWvfE7rlM34vsYDXe48LwUhX0JZxCyXKEkzjFLLz0gyh5Fio84c0KPMgfCRE5eahSeZTg6sEKH1q8wu2CgNEsJWvfF5hSjFkjRHG11z8Dpww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mr.mail.ne1.yahoo.com with HTTP; Tue, 19 Jun 2018 21:17:56 +0000 Received: from 104.129.194.193 (EHLO ip-192-168-1-143.ec2.internal) ([104.129.194.193]) by smtp413.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 3acd02d03da2c4665031aba1842857d8; Tue, 19 Jun 2018 21:17:51 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: Load data from a csv file without using COPY From: Ravi Krishna In-Reply-To: Date: Tue, 19 Jun 2018 17:17:46 -0400 Cc: PG mailing List Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Alban Hertroys X-Mailer: Apple Mail (2.3445.8.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >=20 > 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 =E2=80=94inserts. >=20 This was my first thought too. However, as I understand, pg_dump = --insert basically runs INSERT INTO ... sql for every row. =20 In other words, each row is un-prepared and executed individually. That = is also not real life scenario.