X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 68A983A3CCC for ; Tue, 2 Nov 2004 15:20:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 80921-04 for ; Tue, 2 Nov 2004 15:20:41 +0000 (GMT) Received: from mail.logi-track.com (www.logi-track.com [213.239.193.212]) by svr1.postgresql.org (Postfix) with ESMTP id C45D73A3C7C for ; Tue, 2 Nov 2004 15:20:42 +0000 (GMT) Received: from kingfisher.intern.logi-track.com (J2582.j.pppool.de [85.74.37.130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.logi-track.com (Postfix) with ESMTP id 35F4B3033B; Tue, 2 Nov 2004 16:20:45 +0100 (CET) Received: from kingfisher.intern.logi-track.com (localhost [127.0.0.1]) by kingfisher.intern.logi-track.com (Postfix) with SMTP id 57776AB340; Tue, 2 Nov 2004 16:20:39 +0100 (CET) Date: Tue, 2 Nov 2004 16:20:37 +0100 From: Markus Schaber To: PostgreSQL SQL Subject: Re: Update instead rules on Views Message-ID: <20041102162037.306d4d0a@kingfisher.intern.logi-track.com> In-Reply-To: <20041102130507.2acf486a@kingfisher.intern.logi-track.com> References: <20041102130507.2acf486a@kingfisher.intern.logi-track.com> Organization: logi-track ag, =?ISO-8859-15?Q?z=FCrich?= X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-pc-linux-gnu) X-Face: Nx5T&>Nj$VrVPv}sC3IL&)TqHHOKCz/|)R$i"*r@w0{*I6w; UNU_hdl1J4NI_m{IMztq=>cmM}1gCLbAF+9\#CGkG8}Y{x%SuQ>1#t:; Z(|\qdd[i]HStki~#w1$TPF}:0w-7"S\Ev|_a$K wrote: > -- But to remain compatibility with old apps, we also need to manage > -- updates to the view, which are to be rewritten as follows: > CREATE RULE testview_update_rule=20 > AS ON UPDATE TO testview DO INSTEAD=20 > UPDATE realdata SET=20 > index =3D NEW.index, > data =3D NEW.data, > obsolete=3DNULL > ; I now got it to work with adding a "WHERE index=3DNEW.index" to the view. Am I correct in my assumption that this means that this only works when I have a primary key (or at least unique) row in my dataset? Thanks, Markus --=20 markus schaber | dipl. informatiker logi-track ag | rennweg 14-16 | ch 8001 z=FCrich phone +41-43-888 62 52 | fax +41-43-888 62 53 mailto:schabios@logi-track.com | www.logi-track.com