From: Joe Dieckert <dieckert@cabnet.net>
To: Peter T Mount <peter@retep.org.uk>
Cc: Matthew Hagerty <matthew@venux.net>
Cc: pgsql-interfaces@postgreSQL.org
Subject: Re: [INTERFACES] Fastest import?
Date: Sun, 11 Apr 1999 10:16:46 -0700
Message-ID: <3710D8FE.735ACE80@cabnet.net> (raw)
References: <Pine.LNX.4.04.9904110919010.18496-100000@maidast.retep.org.uk>
AppGEN works nicely.
Peter T Mount wrote:
> On Sat, 10 Apr 1999, Matthew Hagerty wrote:
>
> > Greetings,
> >
> > 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.
> >
> > I initially had my program issue the insert commands instead of writing
> > them to a text file, but the import took about 2 hours! We are only
> > talking about 4Meg worth of data here, it should not take that long should
> > it? I was hoping that once in a text file that psql < text.file would be
> > faster, but it is not. Is there any way to speed this up?
> >
> > I was also looking at the copy command and maybe using the binary mode, but
> > writing out binary data is not my idea of a good time and I'm on a deadline
> > here. Is there a program out there that might take a text file of insert
> > statements and convert them to a binary format that copy can use?
> >
> > Any insight would be greatly appreciated.
>
> Why use binary? Just get your program to output Tab delimited ASCII
> data, and use ASCII COPY.
>
> Tip: Don't create your indices before the copy. It will load faster
> without them. Once the data's in there, then create them.
>
> Peter
>
> --
> Peter T Mount peter@retep.org.uk
> Main Homepage: http://www.retep.org.uk
> PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
> Java PDF Generator: http://www.retep.org.uk/pdf
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 using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: dieckert@cabnet.net, peter@retep.org.uk, matthew@venux.net
Subject: Re: [INTERFACES] Fastest import?
In-Reply-To: <3710D8FE.735ACE80@cabnet.net>
* 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