pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Patrick Welche <prlw1@newn.cam.ac.uk>
To: matthew@venux.net
Cc: pgsql-interfaces@postgresql.org
Subject: Re: [INTERFACES] Fastest import?
Date: Sun, 11 Apr 1999 10:55:57 +0100 (BST)
Message-ID: <E10WGy5-0004V5-00@quartz.newn.cam.ac.uk> (raw)
In-Reply-To: <4.1.19990410172612.009943e0@mail.venux.net>

> 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



view thread (5+ messages)  latest in thread

Message-ID: <E10WGy5-0004V5-00@quartz.newn.cam.ac.uk>
Permalink:  ../E10WGy5-0004V5-00@quartz.newn.cam.ac.uk/
Also on:    postgresql.org/message-id/E10WGy5-0004V5-00@quartz.newn.cam.ac.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-interfaces@postgresql.org
  Cc: prlw1@newn.cam.ac.uk, matthew@venux.net
  Subject: Re: [INTERFACES] Fastest import?
  In-Reply-To: <E10WGy5-0004V5-00@quartz.newn.cam.ac.uk>
  References: <4.1.19990410172612.009943e0@mail.venux.net> <E10WGy5-0004V5-00@quartz.newn.cam.ac.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox