On Thu, Aug 22, 2013 at 6:36 PM, Ian Lawrence Barwick <barw...@gmail.com>wrote:

> INSERT INTO t (t_field1, t_field2, t_field3)
>   SELECT r.field1, r.field2, (x+y)
>     FROM r
>

Obligatory link to documentation:
http://www.postgresql.org/docs/9.2/static/sql-insert.html. See where it
says [ ( *column_name* [, ...] ) ]? The square brackets mean "optional",
and the ",..." means repeat as needed. The fact "column_name" is italics
tell you it's some kind of variable text you should replace, and later on
in the page explains what goes there. So it's telling you that you can use
a comma separated list of column names from the destination table.
PostgreSQL has some of the best documentation of any software I've ever
seen. Don't hesitate to check it often when working.

Reply via email to