On Thursday 21 September 2006 13:10, Christoph Zwerschke wrote:
> Sean Davis wrote:
> > By copy support, I mean writing rows directly to the server socket.  I
> > can do this with pg like so:
> >
> > db.query('copy table from stdin')
> > for row in rows:
> >     db.putline(row + "\n")
> > db.endcopy()
>
> You can use the inserttable of pg's database connection for this.
>
> > I can import and connect via pg for this, but using pgdb instead seems
> > like it might be worth it for the future.
>
> If db is a pgdb connection, the inserttable method is available as
> db._pgdbCnx__cnx.inserttable

That is good to know.  Without testing it, does that mean that a 
db._pgdbCns__cnx is a pg connection object, or is it something else 
altogether?  

The reason to maintain the putline() interface is for easy coding for the 
insertion of LARGE tables (those that don't fit into memory), which we do a 
good deal of.

Thanks for the hint.  I'm relatively new to python and pygresql, after coming 
from perl.  Is there a place where the _pgdbCns__cnx is documented, or is it 
just a question of looking at the source?

Sean
_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql

Reply via email to