keeping track of inserts (periodical) into a table

From: Assad Jarrahian <jarraa(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: keeping track of inserts (periodical) into a table
Date: 2005-12-04 06:33:02
Message-ID: 4bd3e1480512032233n5ef98622t6241bfbe4c2f3a99@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,
I have a design decission to make. I am using Lucene (Java Search
API) and I need to update lucenes index from time to time.
Is there a way one can keep track of all the inserts coming
into a table (holding onto their Primary key's are sufficient) and
then reseting that after a certain time period?

I have an idea(see below), but your suggestions would be appreicated.

1) Create a view from the table (empty). Have a trigger that inserts
into the view everytime that table gets updated. Then when that view
gets read by the necessary piece of code, the view gets emptied
(deleted and a new view is created). Not sure if this will work.

Any help is much appreciated.

-assad

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Qingqing Zhou 2005-12-04 06:51:52 Re: keeping track of inserts (periodical) into a table
Previous Message Karl O. Pinc 2005-12-04 06:06:51 Re: Use of %ROWTYPE in plpgsql function declarations