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
обсуждение исходный текст
Ответы Re: Trigger for updating view with join
Список pgsql-sql
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
Дата:
Сообщение: Re: Find Out a Way to Recover Data From Android Phone
Следующее
От: Dmitry Morozovsky
Дата:
Сообщение: Re: Trigger for updating view with join