Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZAfv-0006qj-P8 for pgsql-general@arkaria.postgresql.org; Tue, 18 Dec 2018 08:24:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZAft-0004Lt-2k for pgsql-general@arkaria.postgresql.org; Tue, 18 Dec 2018 08:24:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZAfs-0004Lm-Na for pgsql-general@lists.postgresql.org; Tue, 18 Dec 2018 08:24:20 +0000 Received: from mx1.mailbox.org ([2001:67c:2050:104:0:1:25:1]) by makus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZAfl-0006DL-Bj for pgsql-general@postgresql.org; Tue, 18 Dec 2018 08:24:19 +0000 Received: from smtp1.mailbox.org (unknown [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id E2F864952E; Tue, 18 Dec 2018 09:24:06 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter03.heinlein-hosting.de (spamfilter03.heinlein-hosting.de [80.241.56.117]) (amavisd-new, port 10030) with ESMTP id KSth1bfjf1KS; Tue, 18 Dec 2018 09:24:05 +0100 (CET) Message-ID: <80ed60d54a29cb8bf3058dc0b9f5d44cf244378c.camel@cybertec.at> Subject: Re: How to insert bulk data with libpq in C? From: Laurenz Albe To: a <372660931@qq.com>, pgsql-general Date: Tue, 18 Dec 2018 09:24:04 +0100 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk a wrote: > May I ask the proper (fast) way of inserting bulk data and if possible, an example would be very appreciated. > > Please note that the data I would like to insert contains arrays (float8[]). > > By the way, my environment is Windows 10, PostgreSQL 11 and compiling with Visual Studio 2017. That would be COPY: https://www.postgresql.org/docs/current/sql-copy.html Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com