agora inbox for postgres@postgres.berkeley.edu
help / color / mirror / Atom feedFrom: Mark Victor Priester <priester@student.msu.edu>
To: postgres@postgres.Berkeley.EDU
Subject: Another import question
Date: Tue, 12 Apr 1994 10:12:36 -0400 (EDT)
Message-ID: <9404121412.AA78322@student4.cl.msu.edu> (raw)
Sorry to beat up on an already battered and bruised topic, but ...
I have a large datafile that I wish to massage into a Postgres database.
I guess the only difference from other posts is that it's not ASCII ;)
I have written a chunk of code that does the following
PQsetdb("blah");
PQexec("begin");
1. read current line of datafile
2. build string of form "append CASE (name = "string, ...)"
The object CASE already defined in "blah" from monitor.
3. send string to backend with PQexec(string from #2)
PQexec("end");
A couple of comments in no particular order:
(actually they're in numerical order I guess ;) )
1. This works fine for 10 instances/lines even for 100 instances,
but when I set it to work on the whole file (~1.5M instances)
it chokes early on in the game. Is there something I need to do
to keep the backend in sync with my process?
2. I have no particular sentimental attachment to this particular approach.
Any suggestions are welcome.
3. I am running this on SunOS 4.1.1
4. I will be doing this (hopefully) several times in the future and would
like comments/thoughts on the fastest way to import from a file.
Thanks for you time,
Mark
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Mark Priester _/ Phone: 517.694.4789 _/
_/ Barros Research Institute _/ Fax: 517.694.4788 _/
_/ 2430 College Road _/ Internet: priester@student.msu.edu _/
_/ Holt, MI 48842 _/ priester@m-net.ann-arbor.mi.us _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
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 using the --to and --cc options:
reply via email
To: postgres@postgres.berkeley.edu
Cc: priester@student.msu.edu
Subject: Re: Another import question
In-Reply-To: <9404121412.AA78322@student4.cl.msu.edu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox