Re: inserting to a multi-table view
От | Michael Shulman |
---|---|
Тема | Re: inserting to a multi-table view |
Дата | |
Msg-id | c3f821000806162040ia5123asae397950270ad2ba@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: inserting to a multi-table view ("Scott Marlowe" <scott.marlowe@gmail.com>) |
Ответы |
Re: inserting to a multi-table view
|
Список | pgsql-general |
On Mon, Jun 16, 2008 at 10:03 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote: >> I can write a trigger >> function that does the right thing, with 'INSERT ... RETURNING >> person_id INTO ...', but Postgres will not let me add an INSERT >> trigger to a view; it says 'ERROR: "studentinfo" is not a table'. > > Got a short example of what you've tried so far? create function ins_st() returns trigger as $$ declare id integer; begin insert into person (...) values (NEW....) returning person_id into id; insert into student (person_id, ...) values (id, NEW....); end; $$ language plpgsql; create trigger ins_student before insert on studentinfo for each row execute procedure ins_st(); ERROR: "studentinfo" is not a table Mike
В списке pgsql-general по дате отправления: