Re: Time-based trigger - Mailing list pgsql-general

From Szymon Guz
Subject Re: Time-based trigger
Date
Msg-id CAFjNrYvKLpO5Dnx11O+2aJt4ifQOjT1VdjGtRMDsXJVEescU-g@mail.gmail.com
Whole thread Raw
In response to Time-based trigger  (Robert Sosinski <rsosinski@ticketevolution.com>)
Responses Re: Time-based trigger
List pgsql-general
On 18 September 2012 17:59, Robert Sosinski <rsosinski@ticketevolution.com> wrote:
We have a table, which has items that can be put on hold of 5 minutes (this is for an online store) once they are placed into a cart.  What we need is for this hold to automatically expire after 5 minutes.  Right now, we put a time stamp into the row (called hold_until) at 5 minutes into the future, and select items where hold_until is less then now().

Would it be possible to change this to using a boolean that is set to true when item is put on hold, and have something like a time-based trigger automatically update the held boolean to false after 5 minutes pass.

Thanks,

-- 
Robert Sosinski


It is not possible right now, however I'd rather create some cron job which updates the boolean value if needed and runs each minute.

- Szymon

pgsql-general by date:

Previous
From: Robert Sosinski
Date:
Subject: Time-based trigger
Next
From: Yvon Thoraval
Date:
Subject: Re: On Ubuntu 12.04 i do have two psql one of those isn't working