Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VH0BX-0005wz-Dq for pgsql-sql@arkaria.postgresql.org; Tue, 03 Sep 2013 23:38:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VH0BW-0005bh-Su for pgsql-sql@arkaria.postgresql.org; Tue, 03 Sep 2013 23:38:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VH0BU-0005bY-TL for pgsql-sql@postgresql.org; Tue, 03 Sep 2013 23:38:56 +0000 Received: from woozle.rinet.ru ([195.54.192.68]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VH0BR-0004Z1-Li for pgsql-sql@postgresql.org; Tue, 03 Sep 2013 23:38:56 +0000 Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id r83NcqFO080381 for ; Wed, 4 Sep 2013 03:38:52 +0400 (MSK) (envelope-from marck@rinet.ru) Date: Wed, 4 Sep 2013 03:38:52 +0400 (MSK) From: Dmitry Morozovsky To: pgsql-sql@postgresql.org Subject: Trigger for updating view with join Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Wed, 04 Sep 2013 03:38:53 +0400 (MSK) X-Pg-Spam-Score: -3.7 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org 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 *** ------------------------------------------------------------------------ -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql