Trigger for updating view with join

Поиск
Список
Период
Сортировка
Искать
От
Dmitry Morozovsky
Тема
Trigger for updating view with join
Дата
Msg-id
alpine.BSF.2.00.1309040335020.75311@woozle.rinet.ru
Список
Дерево обсуждения
Trigger for updating view with join Dmitry Morozovsky <marck@rinet.ru>
Re: Trigger for updating view with join Dmitry Morozovsky <marck@rinet.ru>
Re: Trigger for updating view with join Dmitry Morozovsky <marck@rinet.ru>
Dear colleagues,

I'm running Pg 9.1 and have schema like the following:

create table machines (       mid     serial not null primary key,       mname   text not null unique
);

create table fs (       fsid    serial not null primary key,       mid     int not null references machines,       mpoint  text not null
);
create unique index fs_mp on fs(mid, mpoint);

create view fsl as       select fsid,mid,mname,mpoint       from fs join machines using(mid);


Now, I want to create trigger so I can issue

insert into fsl (mname,mpoint) values ('server','/usr')

I understand I should use smth like 

create trigger fsl_update instead of insert or update on fsl ...

but till now did not succeed in it.  Quick googlink did not help either.

Could you point me to the right direction?

Thank you!


-- 
Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer:                                 marck@FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------


В списке pgsql-sql по дате отправления
От: walerina
Дата:
От: Dmitry Morozovsky
Дата:
FAQ