Received: from napraforgo.helyi (line-172-109.dial.matav.net [145.236.172.109]) by hub.org (8.10.1/8.10.1) with ESMTP id e6UGPqB48709 for ; Sun, 30 Jul 2000 12:25:52 -0400 (EDT) Received: from napraforgo (napraforgo.penguinpowered.com) [192.168.8.2] by napraforgo.helyi with esmtp (Exim 3.12 #1 (Debian)) id 13Ivrg-0007nl-00; Sun, 30 Jul 2000 18:23:00 +0200 Message-ID: X-Mailer: XFMail 1.4.4 on Linux X-Priority: 3 (Normal) Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Sun, 30 Jul 2000 18:23:00 +0200 (CEST) From: dbalazs@homemail.com To: pgsql-sql@postgresql.org Subject: view's rule -> update X-Archive-Number: 200007/283 Hello, I would liko to update a table from a view's rule: The environment: ------------------------------- CREATE TABLE real (name text); CREATE TABLE alibi (name text); CREATE TABLE alibi_view (name text); CREATE RULE "_RETalibi_view" AS ON SELECT TO alibi_view DO INSTEAD SELECT name FROM alibi; CREATE RULE "_UPDalibi_view" AS ON UPDATE TO alibi_view DO INSTEAD UPDATE real SET name=NEW.name --WHERE name=OLD.name ; INSERT INTO real VALUES ('first'); INSERT INTO real VALUES ('sec'); ------------------------------- UPDATE alibi_view SET name='new' WHERE name='sec'; --> UPDATE 0 ...it is my problem UPDATE alibi_view SET name='new'; --> UPDATE 2 ... it is OK If I don't comment the line "where .." in the rule _UPDalibi_view , it isn't working at all. Can I do this with rule? (I need the view to controll permissions.) Thanks in advance, DBalazs (postgresql 7.02)