Need help with db script, and daily routines

From: "Peter Neu" <peter(dot)neu(at)gmx(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Need help with db script, and daily routines
Date: 2007-04-19 13:28:18
Message-ID: 019b01c78286$97f2aa80$bcc8a8c0@PCMELZER
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have 2 tables:

In one I log the user name of a web site user like this:

Name Access time
"makost0001" " 2007-04-19 15:09:19"
"makost0001" " 2007-04-19 15:09:19"

In the other I have the user name his group and the expiry date of his
account.

Name Group Expiry date
"makost0001" "book" "2013-04-05 09:41:25.357677"

When the user accesses the web site for the first time I need to change the
expiry date
to < today > + 3 years.

Problem is I need to do this on a regular basis once a day to avoid table
locks. And also how do I tell the program to find the earliest access time
of a user? Like shown above there a multiple
entries for the same time & user because of the multiple requests. :o(

Should I have a field in the first table like <ignore this entry forever>
when an expiry date is already set?

I'm pretty new to db programming and especially to PostgreSQL. Can somebody
please help?

Cheers,
Pete

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2007-04-19 13:30:02 Re: Auditing a database
Previous Message Kenneth Downs 2007-04-19 13:27:33 Re: Auditing a database