Re: Populating large DB from Perl script - Mailing list pgsql-general

From Kynn Jones
Subject Re: Populating large DB from Perl script
Date
Msg-id c2350ba40711021145r7c630ec9r7bb9c2ff74b25ca6@mail.gmail.com
Whole thread Raw
In response to Re: Populating large DB from Perl script  (andy <andy@squeakycode.net>)
Responses Re: Populating large DB from Perl script  (andy <andy@squeakycode.net>)
Re: Populating large DB from Perl script  ("Mikko Partio" <mpartio@gmail.com>)
List 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!

pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: Cybercluster
Next
From: "Dawid Kuroczko"
Date:
Subject: Re: Populating large DB from Perl script