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

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Norman Khine <norman(at)khine(dot)net>
Cc: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>, 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:22:59
Message-ID: 20020714212259.GA16115@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sun, Jul 14, 2002 at 22:10:36 +0100,
Norman Khine <norman(at)khine(dot)net> 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 ...

insert into products (column1, column2, column3) select * from csv;

> or take table csv and put column1 and column 4 into table price

insert into price select column1, column4 from csv;

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2002-07-14 21:34:38 Re: Multiple table insert using a CSV list as the datasource
Previous Message Chris Palmer 2002-07-14 21:21:10 Re: Multiple table insert using a CSV list as the datasource