Functions performed on intervals - Mailing list pgsql-sql

From Jimmie Fulton
Subject Functions performed on intervals
Date
Msg-id FB93404FB67ED311ABF9009027991188417EBF@www.ehso.emory.edu
Whole thread Raw
Responses Re: Functions performed on intervals  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
I hope this is not the wrong list for this type of question...

I'm about to start development on a small app to track employee leave and
vacation time.  Based on a simple formula, each employee gets x number of
days at the end of each month.  x is a function of time-in-service and
employee type: part-time, full-time, and salary.  I could just write a view
to display total time accumulated from their start date to current date
(minus leave taken), but what happens when the employee moves from part-time
to full-time?  Their entire leave is recalculated with the new formula and
the employee gets some extra time off.  The solution I've thought of is to
call a function once a month with cron to update each employee's leave
balance.  Is this the proper way to accomplish this task or are there better
methods or approaches to getting the desired effect?

Thanks for any advice you can give,

Jimmie Fulton
Systems Administrator
Emory University School Of Medicine



pgsql-sql by date:

Previous
From: Patrik Kudo
Date:
Subject: Re: C Functions
Next
From: "Josh Berkus"
Date:
Subject: Re: Functions performed on intervals