Hello Christoph,
thanks for your answer.
On Tue, Aug 02, 2005 at 02:09:53PM +0200, Christoph Zwerschke wrote:
> Wolf Wiegand schrieb:
> >cur.execute("\\COPY packages_on_systems FROM '/tmp/tmpFCpuv_'")
> >However, this always returns the error:
> >pgdb.DatabaseError: error 'ERROR: syntax error at or near "\" at
>
> The problem is that you can only execute SQL commands that way.
> "\COPY" is not a SQL command, but one of the psql meta-commands.
> Luckily, there is also a SQL version of the \COPY command.
> The syntax is similar, but without the backslash.
This doesn't work, though, if I try to insert a local file to a remote
database, using a regular user, right? At least, I get the following
error message:
pgdb.DatabaseError: error 'ERROR: must be superuser to COPY to or from a file
I don't have any possibilities to transfer to text file to the db server
beforehand.
> Alternatively, you can also use the inserttable command from the
> classic PyGreSQL interface pg.py, which is also based on \copy.
Thanks, I'll start looking into that right now.
Generally, what I am trying to achieve is to insert quite a large amount
of data as fast as possible to a remote database. Would inserttable be
a reasonable way to do that?
Thanks again for your help,
Wolf
_______________________________________________
PyGreSQL mailing list
[email protected]
http://mailman.vex.net/mailman/listinfo/pygresql