Re: Column names for INSERT with query

Поиск
Список
Период
Сортировка
От BladeOfLight16
Тема Re: Column names for INSERT with query
Дата
Msg-id CA+=1U=VmT8KjEhfgHkxdgJuckmcyLfsEAerC_cSWqAo7UY=P2g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Column names for INSERT with query  (Ian Lawrence Barwick <barwick@gmail.com>)
Список pgsql-general
On Thu, Aug 22, 2013 at 6:36 PM, Ian Lawrence Barwick <barwick@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.

В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Temp files on Commit
Следующее
От: Vincent Veyron
Дата:
Сообщение: Re: Locale Issue