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

Re: trigger/rule question

From: Enrico Weigelt <weigelt(at)metux(dot)de>
To: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: trigger/rule question
Date: 2005-05-02 03:41:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
* Christoph Haller <ch(at)rodos(dot)fzk(dot)de> wrote:


> I assume this still refers to 
> [SQL] RULE for mtime recording 
> from last Friday. 

ehm, yeah. I forgot that I've already asked this stuff ...
hmmpf. seems I'm not getting younger ;-)

> I gave it another thought and 
> I am now having something which seems to work. 
> The trick is interpose a view to avoid the 
> rule recursion: 

<big_snip />

correct me if I'm wrong: 

you dont let the application write to the actual storage table, but 
instead to a view, which a modified write to the actual storage, where
also the reads get their data from.

okay, that's really an idea worth to think about :)

insert should work the same way. but how to implement delete ? 
(the application should only see one table, so in our case the view).
if we user "DO INSTEAD", we wont get anything to delete (AFAIK), so 
we cannot intercept here. the only chance seems to leave out "INSTEAD"
and live with duplicate data.

Did I miss anyting ?

 Enrico Weigelt    ==   metux IT service
  phone:     +49 36207 519931         www:
  fax:       +49 36207 519932         email:     contact(at)metux(dot)de
  Realtime Forex/Stock Exchange trading powered by postgresSQL :))

In response to


pgsql-sql by date

Next:From: Leo FinkDate: 2005-05-02 03:50:37
Subject: Array of Arrays of int
Previous:From: Enrico WeigeltDate: 2005-05-02 03:31:34
Subject: Re: trigger/rule question

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