[Q] PyGreSQL

Gerhard Häring gh_pythonlist at gmx.de
Mon Oct 1 14:21:29 CEST 2001

On Mon, Oct 01, 2001 at 11:50:53AM +0000, Mart van de Wege wrote:
> In <jlvt7.1464$sc.18887 at vixen.cso.uiuc.edu>, Seung-won Hwang wrote:
> Assuming you are running PostgreSQL, use the 'COPY FROM' SQL command.
> I believe it defaults to tabs as field seperators, otherwise you can
> define that in the command. <Digs up PostgreSQL book>Yep that's it.
> First do a 'CREATE TABLE' to define the columns, then 'COPY
> <tablename> FROM <filename>' will fill it.  You might want to check
> out http://www.postgresql.org/docs/awbook.html for Bruce Momjian's
> book.

Cool. I browsed the docs but didn't find it. I thought there must be an
equivalent for MySQL's LOAD DATA INFILE. And there is. Good to know.

mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))

More information about the Python-list mailing list