Re: trigger on view returning created serial

Поиск
Список
Период
Сортировка
Искать
От
Jeff Davis
Тема
Re: trigger on view returning created serial
Дата
Msg-id
1339544439.12295.107.camel@sussancws0025
Ответ на
Список
Дерево обсуждения
trigger on view returning created serial Philipp Kraus <philipp.kraus@flashpixx.de>
Re: trigger on view returning created serial Jeff Davis <pgsql@j-davis.com>
On Tue, 2012-06-12 at 22:35 +0200, Philipp Kraus wrote:
> Hello,
> 
> I have created a view and on this view a trigger, which is called on an insert command on the view.
> Within the trigger I run an insert on a table and one of the table fields uses a serial sequence, that
> creates values. If I run in the trigger after the insert a "return NEW", the field (id) which should
> be set by the serial on the table is 0, so how can I get the new created serial on the insert command
> within the trigger function?

It's hard for me to tell exactly what problem you're describing, but it
sounds similar to the one solved here:

http://people.planetpostgresql.org/dfetter/index.php?/archives/66-VIEW-triggers-RETURNING....html

If I misunderstood, please be more descriptive about what you are trying
to do, what code you wrote, and what went wrong.

Regards,
	Jeff Davis

В списке pgsql-general по дате отправления
От: Jeff Davis
Дата:
От: David Johnston
Дата:
Сообщение: Re: UPDATE Syntax Check
FAQ