Re: BUG #5400: Columns count mismatch in RULE with subquery

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5400: Columns count mismatch in RULE with subquery
Дата
Msg-id 20806.1270046117@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #5400: Columns count mismatch in RULE with subquery  ("Teodor Buchner" <t.buchner@autoguard.pl>)
Список pgsql-bugs
"Teodor Buchner" <t.buchner@autoguard.pl> writes:
> CREATE OR REPLACE RULE move_iteration_1 AS ON INSERT TO a.iteration  DO ALSO

> INSERT INTO b.iteration(id,date_period_begin)
>     SELECT (NEW.id,NEW.date_period_begin) FROM a.iteration;

Your use of parentheses in the SELECT targetlist is incorrect (and would
be with or without the RULE context).  What this is trying to do is
insert a single composite column into the target table.  You want

INSERT INTO b.iteration(id,date_period_begin)
    SELECT NEW.id,NEW.date_period_begin FROM a.iteration;

            regards, tom lane

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: dividing money by money
Следующее
От: Andy Balholm
Дата:
Сообщение: Re: dividing money by money