pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Shaozhong SHI <shishaozhong@gmail.com>
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: Testing of a fast method to bulk insert a Pandas DataFrame into Postgres
Date: Mon, 4 Oct 2021 09:06:40 -0700
Message-ID: <a6105435-6bfd-8776-fe38-13ffab752f23@aklaver.com> (raw)
In-Reply-To: <CA+i5JwY1jDx3jyBCkuJQhOyPELAoYVFtOmCqgxotTXmGc3wO9g@mail.gmail.com>
References: <CA+i5JwYnUBCKSnWn96OvtF66oGYHNGefMd5V_Bgceu=4PtcDNw@mail.gmail.com>
	<CA+i5JwY1jDx3jyBCkuJQhOyPELAoYVFtOmCqgxotTXmGc3wO9g@mail.gmail.com>

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 
> <https://ellisvalentiner.com/post/a-fast-method-to-insert-a-pandas-dataframe-into-postgres/;
> 
> 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.Da...

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





view thread (12+ messages)  latest in thread

Message-ID: <a6105435-6bfd-8776-fe38-13ffab752f23@aklaver.com>
Permalink:  ../a6105435-6bfd-8776-fe38-13ffab752f23@aklaver.com/
Also on:    postgresql.org/message-id/a6105435-6bfd-8776-fe38-13ffab752f23@aklaver.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: adrian.klaver@aklaver.com, shishaozhong@gmail.com
  Subject: Re: Testing of a fast method to bulk insert a Pandas DataFrame into Postgres
  In-Reply-To: <a6105435-6bfd-8776-fe38-13ffab752f23@aklaver.com>
  References: <CA+i5JwYnUBCKSnWn96OvtF66oGYHNGefMd5V_Bgceu=4PtcDNw@mail.gmail.com> <CA+i5JwY1jDx3jyBCkuJQhOyPELAoYVFtOmCqgxotTXmGc3wO9g@mail.gmail.com> <a6105435-6bfd-8776-fe38-13ffab752f23@aklaver.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