Database query: Notification about change?

From: Erik Sigra <sigra(at)kth(dot)se>
To: pgsql-sql(at)postgresql(dot)org
Subject: Database query: Notification about change?
Date: 2005-12-05 18:22:22
Message-ID: 4394855E.6060201@kth.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,
I plan to develop an application that is somewhat like a spreadsheet
with cells containing formulas. When a cell value is changed, things
must be updated. But the formulas can contain database queries, which
means that the cell has to be notified when the database changes in such
a way that the result of the query changes. How is this done? I would
really like to avoid recalculating the whole thing for each change to
the database.

I looked in my database book and read about materialized views and
triggers. It seems like I should do the following:
1. Make a materialized view from the query.
2. Add a trigger for changes to this view.
3. Make the trigger notify the application program when it is trigged.

Would this be possible? (I was planning to use Qt for application
programming and database access.)

Thanks,
Erik

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Eric E 2005-12-05 19:02:27 Preventing or controlling runaway queries
Previous Message Patrick JACQUOT 2005-12-05 10:43:22 Re: Just 1 in a series...