keeping track of inserts (periodical) into a table

Started by Assad Jarrahianover 20 years ago2 messagesgeneral
Jump to latest
#1Assad Jarrahian
jarraa@gmail.com

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

#2Qingqing Zhou
zhouqq@cs.toronto.edu
In reply to: Assad Jarrahian (#1)
Re: keeping track of inserts (periodical) into a table

"Assad Jarrahian" <jarraa@gmail.com> wrote

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?

Check out the example here:

http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html

Regards,
Qingqing