Received: from henry.newn.cam.ac.uk (root@henry.newn.cam.ac.uk [131.111.204.130]) by hub.org (8.9.2/8.9.1) with SMTP id FAA66441 for ; Sun, 11 Apr 1999 05:56:02 -0400 (EDT) (envelope-from prlw1@newn.cam.ac.uk) Received: from quartz.newn.cam.ac.uk by henry.newn.cam.ac.uk with smtp (Smail3.1.29.1 #33) id m10WGyk-000IYWC; Sun, 11 Apr 99 10:56 BST Received: from prlw1 by quartz.newn.cam.ac.uk with local (Exim 2.12 #1) id 10WGy5-0004V5-00; Sun, 11 Apr 1999 10:55:57 +0100 Subject: Re: [INTERFACES] Fastest import? To: matthew@venux.net (Matthew Hagerty) Date: Sun, 11 Apr 1999 10:55:57 +0100 (BST) From: "Patrick Welche" Cc: pgsql-interfaces@postgresql.org Reply-To: prlw1@cam.ac.uk In-Reply-To: <4.1.19990410172612.009943e0@mail.venux.net> from "Matthew Hagerty" at Apr 10, 99 05:36:29 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: > What is the fastest way to import data from an ASCII file? I have ~17,000 > records in a .DBF file that I need to get into my pg6.4.2 database. I have > written a program that reads the .DBF file, massages the data and writes it > out to a text file, one record per line. Funny, I just reinvented the wheel too on Friday. > I initially had my program issue the insert commands instead of writing > them to a text file, but the import took about 2 hours! Did you surround the inserts with "BEGIN WORK" and "COMMIT"? That is rumoured to help - I only had 6000 rows, so it wasn't a problem. Re the text file, are you using "INSERT" or better "COPY"? Cheers, Patrick