pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Basilis Kladis <bkladis@knowledge.gr>
To: pgsql-sql@postgresql.org
Subject: problem with keyword 'old'
Date: Mon, 27 Nov 2000 15:51:48 +0200
Message-ID: <NEBBKLFBPKPJGEGPOLOEOEKCCBAA.bkladis@knowledge.gr> (raw)

 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@knowledge.gr>

Âáóßëçò ÊëÜäçò
Language Engineering Dept.
KNOWLEDGE S.A.




view thread (2+ messages)  latest in thread

Message-ID: <NEBBKLFBPKPJGEGPOLOEOEKCCBAA.bkladis@knowledge.gr>
Permalink:  ../NEBBKLFBPKPJGEGPOLOEOEKCCBAA.bkladis@knowledge.gr/
Also on:    postgresql.org/message-id/NEBBKLFBPKPJGEGPOLOEOEKCCBAA.bkladis@knowledge.gr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: bkladis@knowledge.gr
  Subject: Re: problem with keyword 'old'
  In-Reply-To: <NEBBKLFBPKPJGEGPOLOEOEKCCBAA.bkladis@knowledge.gr>
  References: <NEBBKLFBPKPJGEGPOLOEOEKCCBAA.bkladis@knowledge.gr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox