Transaction Questions

From: <neil(dot)saunders(at)accenture(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Transaction Questions
Date: 2005-08-19 15:19:57
Message-ID: B74B7433CDDD2C4AA41D94832E32E19D92EE8C@EMEXM1112.dir.svc.accenture.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

Following on from my last question, I'm attempting to write a function that inserts periods. Periods are either bookings, available, or unavailable, each stored in a seperate table, and all have start date and end date columns, all of which inherit a table 'calendar_entries'.

The function needs to check that there are no overlapping periods, so I need to check all three tables - I need to prevent entries being added in parrell for the duration of the function. My question is - Is it sufficient to LOCK calendar_entries IN EXCLUSIVE MODE, or do I need to lock all three tables individually?

Also, inside the function I need to use a transaction in order to DELETE one row, and UPDATE another. Will this 'inner' transaction have write access to all 3 tables?

Just trying to get my head around concurrency - Have a good weekend!

Ta,

Neil.

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2005-08-19 16:39:38 Re: Transaction Questions
Previous Message Devrim GUNDUZ 2005-08-19 14:54:23 Re: Intsall 8.03 on Redhat ES 3