Re: Populating large DB from Perl script

From: "Kynn Jones" <kynnjo(at)gmail(dot)com>
To: andy <andy(at)squeakycode(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Populating large DB from Perl script
Date: 2007-11-02 18:45:05
Message-ID: c2350ba40711021145r7c630ec9r7bb9c2ff74b25ca6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> So... not really an answer (other than I used a stored proc)

Actually, I'm interested in your solution.

Just to make sure I understood what you did: you bulk-populated (i.e.
with $dbh->do('COPY...'), $dbh->pg_putline(...), $dbh->pg_endcopy) the
referring tables, with their fkey constraints disabled; then you ran
stored procedure(s) that went through these referring tables and
filled in the missing fkeys; and finally you activated their fkey
constraints. Is this right?

I'm very much of a stored procedures dunce, so if the code for your
stored procedure is "postable", please do.

TIA,

kj

PS: As an aside to the list, as a programmer, when I'm starting out in
language, I learn more than I can say from reading source code written
by the experts, but for some reason I have had a hard time coming
across expertly written PostgreSQL stored procedures, other than the
occasionally didactic snippet in the docs. All these expertly-written
procedures seem to be very STORED away indeed! If, on the contrary,
it's just the case that I haven't looked in the right places, please
hurl me a cluebrick!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dawid Kuroczko 2007-11-02 18:57:59 Re: Populating large DB from Perl script
Previous Message Joshua D. Drake 2007-11-02 18:12:49 Re: Cybercluster