Re: how to know when a table is altered - Mailing list pgsql-sql

From Ed Loehr
Subject Re: how to know when a table is altered
Date
Msg-id 393E4FCD.1E5D5BC1@austin.rr.com
Whole thread Raw
In response to how to know when a table is altered  ("Vincenzo Passoli" <maweb@hotmail.com>)
List pgsql-sql
Vincenzo Passoli wrote:
> 
> i'm developing a framework (mod_perl+apache) that reads the db-schema and
> explode html forms.
> 
> now i read the schema and cache it into perl-hashes to speedup things.
> 
> my problem is to recognise when a table is altered so that the framework can
> update the related forms connected to the db tables.
> i don't want to read the schema every time.
> 
> How can i implement this ?

My sub-optimal approach was to cache all of the generally static tables
(requiring a restart to reload them if they changed), and query the
rest.  You can avoid a lot of joins by querying the db for the foreign
keys to static tables and then looking them up only in the app cache. 
But caching query results and invalidating them when the underlying
tables changed would greatly simplify my app and speed things up, so I'd
love to hear if others have a better/faster solution here.

Regards,
Ed Loehr


pgsql-sql by date:

Previous
From: Frank G Hahn
Date:
Subject: Re: sql doubts
Next
From: mikeo
Date:
Subject: Re: oracle rownum equivalent?