Re: Multiple table insert using a CSV list as the datasource

From: "Norman Khine" <norman(at)khine(dot)net>
To: "Pgsql-Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Multiple table insert using a CSV list as the datasource
Date: 2002-07-14 21:41:00
Message-ID: EIEOIOLCDOLMCNPHEGDOOEDJDKAA.norman@khine.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thank you all, you have been very helpfull.

-----Original Message-----
From: pgsql-novice-owner(at)postgresql(dot)org
[mailto:pgsql-novice-owner(at)postgresql(dot)org]On Behalf Of Bruno Wolff III
Sent: 14 July 2002 22:35
To: Chris Palmer
Cc: Pgsql-Novice
Subject: Re: [NOVICE] Multiple table insert using a CSV list as the
datasource

On Sun, Jul 14, 2002 at 14:21:10 -0700,
Chris Palmer <chris(at)nodewarrior(dot)org> wrote:
> On Sunday, July 14, 2002, at 02:10 , Norman Khine wrote:
>
> >Is there such an SQL statement where you say:
> >
> >Take table csv and put column 1, 2, 3 into table products where column 1
> >should map to products.column1 etc etc ...
> >or take table csv and put column1 and column 4 into table price
>
> There might be a way to do all that in SQL, but I would do it with a
> short Perl script using the DBI module. It's fairly straightforward, and
> the DBI module's documentation is enough to get you going.

If you are talking about after the data has been put into a temporary
table, I don't think this would be a good idea. Doing the copy with
one insert statement is going to be faster.

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Derek Barrett 2002-07-14 22:41:02 Re: Question regarding contrib/fulltextindexing
Previous Message Bruno Wolff III 2002-07-14 21:34:38 Re: Multiple table insert using a CSV list as the datasource