Hello, I am attempting to design a database that will record the clock-in, lunch and clock-off times for employees and hope use Postgresql + FreeBSD for this task. I've run into a problem regarding how to store the data for the times - from my reading it would seem that the accepted wisdom is the fewer tables the better, but if I just used one table to record the times then how could I prevent employees changing each other's times if they all have INSERT and UPDATE permissions on the same table?
The best ideas I can come up with are for each employee to have their own table (which obviously wouldn't scale well in an organisation with hundreds or thousands of employees), or the other solution being to have the one table but the client application authenticates on behalf of the user using a dedicated account unknown to anyone (apart from the admin) that would then record the time data including the employee's ID number.
On a related issue, once I have the database up and running how could I stop clever users from connecting to it using other tools e.g. pgAdmin III and directly editing the tables they have access to - in other words I would want them to only connect and write to the database using the client I design for it.
Thanks for help and opinions
The best ideas I can come up with are for each employee to have their own table (which obviously wouldn't scale well in an organisation with hundreds or thousands of employees), or the other solution being to have the one table but the client application authenticates on behalf of the user using a dedicated account unknown to anyone (apart from the admin) that would then record the time data including the employee's ID number.
On a related issue, once I have the database up and running how could I stop clever users from connecting to it using other tools e.g. pgAdmin III and directly editing the tables they have access to - in other words I would want them to only connect and write to the database using the client I design for it.
Thanks for help and opinions