pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
problem with keyword 'old'
2+ messages / 2 participants
[nested] [flat]

* problem with keyword 'old'
@ 2000-11-27 13:51  Basilis Kladis <bkladis@knowledge.gr>
  0 siblings, 1 reply; 2+ messages in thread

From: Basilis Kladis @ 2000-11-27 13:51 UTC (permalink / raw)
  To: 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@knowledge.gr>

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: problem with keyword 'old'
@ 2000-12-03 16:06  Jan Wieck <janwieck@Yahoo.com>
  parent: Basilis Kladis <bkladis@knowledge.gr>
  0 siblings, 0 replies; 2+ messages in thread

From: Jan Wieck @ 2000-12-03 16:06 UTC (permalink / raw)
  To: Basilis Kladis <bkladis@knowledge.gr>; +Cc: pgsql-sql

Basilis Kladis wrote:
[Charset iso-8859-7 unsupported, filtering to ASCII...]
>  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:

    First  of  all, the rule system up to version 6.3 is known to
    be broken in several ways. And IIRC delete rules where one of
    the cases that didn't work reliable.

    To  answer your question, in 6.3 the old row is identified by
    the keyword CURRENT, not OLD.


Jan

>
>  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.
>


--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #





^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2000-12-03 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-11-27 13:51 problem with keyword 'old' Basilis Kladis <bkladis@knowledge.gr>
2000-12-03 16:06 ` Jan Wieck <janwieck@Yahoo.com>

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