sql - PostgreSQL automatically update row at specific date -


Once I update one line, I want to reach the specific timestamp in that line. For example, there are deals in an auction site which ends in one day. After that time the deal ends automatically.

Is there a feature in PostGrace SQL, where I can set a line to automatically update when it reaches a specific time period? Otherwise how do I apply this example bargain feature?

One view can work for it Suppose a table T

 < Code> Create table T (deal_ID integer, deal_time timestamp, end time interval); Enter T (deal_id, deal_start, expiry_time) values ​​(1, now (), '1 day');   

If this deal is over, then a view will be Caletrack

  Select View vs. *, now ()> At the end of T, deal_start + expiry_time; Choose from V * Deal_id Deal_start | Expiry_time | Ended --------- + ---------------------------- + -------- - --- + --------- 1 | 2014-04-22 13: 26: 32.319394 | 1 day | F    

Comments

Popular posts from this blog

cmake set_source_files_properties not working properly -

Pygame memory leak with transform.flip -

python - Writing Greek in matplotlib labels, titles -