Trigger for updating view with join - Mailing list pgsql-sql

From Dmitry Morozovsky
Subject Trigger for updating view with join
Date
Msg-id alpine.BSF.2.00.1309040335020.75311@woozle.rinet.ru
Whole thread Raw
Responses Re: Trigger for updating view with join
List 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 by date:

Previous
From: walerina
Date:
Subject: Re: Find Out a Way to Recover Data From Android Phone
Next
From: Dmitry Morozovsky
Date:
Subject: Re: Trigger for updating view with join