Re: psycopg2: connect copy_from and copy_to

2008-02-21 Thread james . pye
On Feb 20, 9:27 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Up to now I am happy with psycopg2. Yeah. psyco is good. > Why do you develop pg_proboscis? [Good or bad as they may be] 1. Alternate interface ("greentrunk") 2. Non-libpq implementation yields better control over the wire that a

Re: psycopg2: connect copy_from and copy_to

2008-02-20 Thread Thomas Guettler
[EMAIL PROTECTED] schrieb: > On Feb 19, 8:06 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: >> Any suggestions? > > If you don't mind trying out some beta quality software, you can try > my pg_proboscis driver. It has a DBAPI2 interface, but for you to use > COPY, you'll need to use the GreenTrunk

Re: psycopg2: connect copy_from and copy_to

2008-02-19 Thread james . pye
On Feb 19, 9:23 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Yes, you can use "pg_dump production ... | psql testdb", but > this can lead to dead locks, if you call this during > a python script which is in the middle of a transaction. The python > script locks a table, so that psql can't write

Re: psycopg2: connect copy_from and copy_to

2008-02-19 Thread Chris
On Feb 19, 6:23 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > > Doesn't PostGres come with Export/Import apps ? That would be easiest > > (and faster). > > Yes, you can use "pg_dump production ... | psql testdb", but > this can lead to dead locks, if you call this during > a python script which

Re: psycopg2: connect copy_from and copy_to

2008-02-19 Thread james . pye
On Feb 19, 8:06 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Any suggestions? If you don't mind trying out some beta quality software, you can try my pg_proboscis driver. It has a DBAPI2 interface, but for you to use COPY, you'll need to use the GreenTrunk interface: import postgresql.interfa

Re: psycopg2: connect copy_from and copy_to

2008-02-19 Thread Thomas Guettler
> Doesn't PostGres come with Export/Import apps ? That would be easiest > (and faster). Yes, you can use "pg_dump production ... | psql testdb", but this can lead to dead locks, if you call this during a python script which is in the middle of a transaction. The python script locks a table, so tha

Re: psycopg2: connect copy_from and copy_to

2008-02-19 Thread james . pye
> Doesn't PostGres come with Export/Import apps ? That would be easiest > (and faster). Yes, PostgreSQL core has import/export apps, but they tend to target general administration rather than transactional loading/moving of data. ie, dump and restore a database or schema. There is a pgfoundry proj

Re: psycopg2: connect copy_from and copy_to

2008-02-19 Thread Chris
On Feb 19, 5:06 pm, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Hi, > > I want to copy data from a production database to > a testing database. Up to now I used psycopg2 and > copy_from and copy_to with two cursors and a temporary file. > > This works, but it would be better, if the data > gets pi

psycopg2: connect copy_from and copy_to

2008-02-19 Thread Thomas Guettler
Hi, I want to copy data from a production database to a testing database. Up to now I used psycopg2 and copy_from and copy_to with two cursors and a temporary file. This works, but it would be better, if the data gets piped from one cursor to the next without a temporary file. The psycopg2 metho