insert tuples through copy

Gaston Droguett <gdroguett-/[email protected]>
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
Hello:
Im trying to insert tuples through the copy sql like
this:

curs.execute('copy tablename from stdin;')
curs.execute('2\t3\4\n')

I get an error:
    self.res = self.conn.conn.query(_qstr)
libpq.ProgrammingError: COPY state must be terminated
first

I can't find the way to send the tuples string.

In C you can do the following:

PQexec(conn,"copy foo from stdin");
PQputline(conn,"3\t4\n");
PQputline(conn,"\\.\n";
PQendcopy(conn);


How can this be done with PgSQL??



_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com


-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.