pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Erik Sigra <sigra@kth.se>
To: pgsql-sql@postgresql.org
Subject: Database query: Notification about change?
Date: Mon, 05 Dec 2005 19:22:22 +0100
Message-ID: <4394855E.6060201@kth.se> (raw)

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




view thread (4+ messages)  latest in thread

Message-ID: <4394855E.6060201@kth.se>
Permalink:  ../4394855E.6060201@kth.se/
Also on:    postgresql.org/message-id/4394855E.6060201@kth.se

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sigra@kth.se
  Subject: Re: Database query: Notification about change?
  In-Reply-To: <4394855E.6060201@kth.se>

* 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