Column names for INSERT with query

From: Robert James <srobertjames(at)gmail(dot)com>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Column names for INSERT with query
Date: 2013-08-22 22:30:37
Message-ID: CAGYyBggz6AK0JBZdY+SwO7k0bsbM0ouL8HPqRHc9GV_NgRyuPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I would like to:

INSERT INTO t
SELECT * FROM r, (x + y) AS field3

How do I correlate the names of the fields? That is, how do I indicate
which fields from r or field3 should be inserted into the right
columns in t?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message bricklen 2013-08-22 22:33:27 Re: Column names for INSERT with query
Previous Message Don Parris 2013-08-22 21:25:47 Re: Locale Issue