Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eAUH3qt42145 for ; Thu, 30 Nov 2000 12:03:52 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from fryni.knowledge.gr (fryni.knowledge.gr [194.30.196.51]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eARDrKt44816 for ; Mon, 27 Nov 2000 08:53:21 -0500 (EST) (envelope-from bkladis@knowledge.gr) Received: from ectoras (ectoras.knowledge.gr [212.37.81.115]) by fryni.knowledge.gr (8.9.3/8.9.3) with SMTP id PAA24584 for ; Mon, 27 Nov 2000 15:49:03 +0200 From: "Basilis Kladis" To: Subject: problem with keyword 'old' Date: Mon, 27 Nov 2000 15:51:48 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-7" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Archive-Number: 200011/287 X-Sequence-Number: 318 I am ussing Postgresql v. 6.3 in a RedHat Linux system. I try to create a rule to log the deletes on table 'filter' ussing the following: CREATE RULE log_delete_filter AS ON DELETE TO filter DO INSERT INTO log_activity (mod_table, mod_record, mod_type) VALUES ('filter', old.did, 'D'); The atributes of tables are: filter (did int4, text text) log_activity (mod_table char(20), mod_rec int4, mod_type char(1) ) I have the following result: ERROR: old: Table does not exist. and the rule is not created. I tested a same rule on INSERT with the keyword new.did and is working perfect. Also I tested the commands: SELECT new.did; > ERROR: NEW used in non-rule query SELECT current.did; >ERROR: CURRENT used in non-rule query SELECT old.did; >ERROR: old: Table does not exist. What is going on? Do you have any idea why does system not undestand keyword 'old'? Sincerely, Basilis Kladis Βασίλης Κλάδης Language Engineering Dept. KNOWLEDGE S.A.