need help in designing a database. - Mailing list pgsql-general

From Haim Ashkenazi
Subject need help in designing a database.
Date
Msg-id pan.2005.11.27.08.54.23.524101@babysnakes.org
Whole thread Raw
Responses Re: need help in designing a database.  (Richard Huxton <dev@archonet.com>)
List pgsql-general
Hi

I'm writing an application that calculates working hours for billing.
there are three levels of billing. one for regular hours, one for
evening/nights, and one for saturdays/holidays.

My first decision is wether I make these calculations in a database view
(If I understand correctly, it would be calculated only once - when
creating the entry or modify it - or am I wrong?) or just put the
regular working hours in the database, and calculate it in the application
(and this way it would be calculated every time I view the page)?

If I'm right and it's better to put it in the database, I really need help
designing the database... (of-course it's an open-source project).

my idea is to create one table that define default hours/days ranges for
the three levels of billing, one table to define client specific ranges, a
table with charging information (charge per hour for every level of
billing for every customer), tables that define custommers, and job
details and a final view that summerize everything.

my main problem is how do I define an hour range from friday 15:00 to
sunday 08:00, and how to create a function that compares the working hours
with this range?

thanx
--
Haim


pgsql-general by date:

Previous
From: Devrim GUNDUZ
Date:
Subject: Re: Tcl Support in the FC4 rpms at posgresql.org?
Next
From: Hill-Managementberatung@t-online.de
Date:
Subject: Usability Question