Re: copy_from and rowcount - Mailing list psycopg

From Federico Di Gregorio
Subject Re: copy_from and rowcount
Date
Msg-id 523C55E3.3010101@dndg.it
Whole thread Raw
In response to copy_from and rowcount  (Ryan Kelly <rpkelly22@gmail.com>)
Responses Re: copy_from and rowcount  (David Blewett <david@dawninglight.net>)
List psycopg
On 12/09/2013 18:06, Ryan Kelly wrote:
> I'm wondering if it's possible to get the number of rows copied when
> using copy_from? I would've thought the .rowcount attribute of the cursor
> would have this value, but that doesn't seem to be the case.

Sorry for the late asnwer.

If I remember correctly the libpq docs don't say if it is possible to
retrieve the number of inserted columns and we're not sending data
line-by-line but as chunks so counting the lines isn't possible. Maybe
(a big maybe) the final PGresult contains that but I can't find this
documented anywhere. We'll need to instrument psycopg to print PGresult
fields and do a bit of guesswork.

federico

--
Federico Di Gregorio                         federico.digregorio@dndg.it
Di Nunzio & Di Gregorio srl                               http://dndg.it
  Those who do not study Lisp are doomed to reimplement it. Poorly.
                                     -- from Karl M. Hegbloom .signature


psycopg by date:

Previous
From: Ryan Kelly
Date:
Subject: copy_from and rowcount
Next
From: David Blewett
Date:
Subject: Re: copy_from and rowcount