Skip site navigation (1) Skip section navigation (2)

problem with keyword 'old'

From: "Basilis Kladis" <bkladis(at)knowledge(dot)gr>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: problem with keyword 'old'
Date: 2000-11-27 13:51:48
Message-ID: NEBBKLFBPKPJGEGPOLOEOEKCCBAA.bkladis@knowledge.gr (view raw or flat)
Thread:
Lists: pgsql-sql
 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 <bkladis(at)knowledge(dot)gr>

Βασίλης Κλάδης
Language Engineering Dept.
KNOWLEDGE S.A.


Responses

pgsql-sql by date

Next:From: Palle GirgensohnDate: 2000-11-27 15:02:04
Subject: Re: CREATE OR REPLACE VIEW
Previous:From: Bruno BoettcherDate: 2000-11-27 11:44:23
Subject: removing a DB??

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group