Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXQUL-00079X-4v for pgsql-general@arkaria.postgresql.org; Mon, 04 Oct 2021 16:06:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mXQUJ-0006pl-RW for pgsql-general@arkaria.postgresql.org; Mon, 04 Oct 2021 16:06:47 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXQUJ-0006pd-IR for pgsql-general@lists.postgresql.org; Mon, 04 Oct 2021 16:06:47 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mXQUG-0000bZ-AQ for pgsql-general@lists.postgresql.org; Mon, 04 Oct 2021 16:06:47 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 4315F5C0115; Mon, 4 Oct 2021 12:06:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 04 Oct 2021 12:06:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=p 69zxqqny2R0BcJA8vYAa0Mnqp2xdZLz1h8BCwxM+dA=; b=uVxNlMOkc1cF16xHV /lTw2R93xu3n9kxAnkJFapjqHKTPu5RWf9ZGeM4rAS9t6rmBbNEZhxadz/isuyx1 QWu5t3sLKBCZXoiPm5zKgYq0KAlInQ9Tf0qF/tOAUfY582Ze3FlII/Tg601wm/Pq 95ixTz27ZRGjvz8ojwa7O9J2PDJQLSPeDDDi606Rm7WPZtK2SujHxvpuAbT16SlI 5A4+tI0IWOeo5JUYpOSJQZKs+UG+Vi55FBO6oScK2BGlHoWQYfgeIl0eYTRMHwC8 dDvfyME31cFimB/ZnvblVTl4k7xgUBAImgydnrxmZvaPmMW8AV1JPuXd4LIq2TMd vvKMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=p69zxqqny2R0BcJA8vYAa0Mnqp2xdZLz1h8BCwxM+ dA=; b=Po8qHCRevgnXnKOyCGYM0+zBWLL1LgjzVLZdIepyTn1ucJmBgz59AfCQg SKixjPs+6w8Ec3fcrORM3Q/byEiSBPrSrS70QxRGv8HQY2VuBoZDChItPBOtNWSW MuI4V7I7GxxI8ThhaWMcv1v1dYvm+ovxxWFJPJ9m9IfjiSjtNpCG2sIFSUudm9cw MXDTsYH5FFro5Dtv5L9sjW7QTf+evW1cMDs2dAnd+GjjZVvtqXPoTCByDBAnWyyX ywZTfT5DTgbN1IpYyku/uDR+0bJW9sEc/wSPzpdT+k7+2wwpI06dO7pOUE6D27Em jnzYrtcKOd+rdfIuRIOls21zUEyqA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelvddgleegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpedtjedvfefgtefhkeehudeuieehfeeuhfdtleeuueet udffffelveevuefhuefhgfenucffohhmrghinhepvghllhhishhvrghlvghnthhinhgvrh drtghomhdpphihuggrthgrrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Oct 2021 12:06:41 -0400 (EDT) Subject: Re: Testing of a fast method to bulk insert a Pandas DataFrame into Postgres To: Shaozhong SHI , pgsql-general References: From: Adrian Klaver Message-ID: Date: Mon, 4 Oct 2021 09:06:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/4/21 8:44 AM, Shaozhong SHI wrote: > > Has anyone tested this one? > A Fast Method to Bulk Insert a Pandas DataFrame into Postgres · Ellis > Valentiner > > > I tried psql_insert_copy method, but I got the following error message. > > to_sql() got an unexpected keyword argument 'method' > > > Can anyone shed light on this? method is a legitimate keyword: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_sql.html?highlight=to_sql#pandas.DataFrame.to_sql So there must be something about how you used it. Pandas version? The actual code you used when the error occurred? > > > Regards, > > > David > -- Adrian Klaver adrian.klaver@aklaver.com