Re: Locking rows - Mailing list pgsql-general

From Richard Huxton
Subject Re: Locking rows
Date
Msg-id 200302281527.40316.dev@archonet.com
Whole thread Raw
In response to Locking rows  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
List pgsql-general
On Friday 28 Feb 2003 10:26 am, Jean-Christian Imbeault wrote:
> I have written an application that prints out data from a database. One
> problem I am encountering is in the time it takes to generate the print
> file the data may have changed.
>
> I was thinking that a way around this would be to lock the rows that are
> used to generate the print file. However I am not quite sure how to best
> go about this.
>
> Is locking the rows the best (or simplest) solution?

See the chapter "Concurrency Control" in the User Guide. Sounds like you want
to set transaction level to serializable - no explicit locking required.

This means that within your report-building transaction you don't see any
changes to the database (unless you do any within the transaction itself).

HTH

--
  Richard Huxton

pgsql-general by date:

Previous
From: Neil Conway
Date:
Subject: Re: 7.4?
Next
From: Neil Conway
Date:
Subject: Re: Locking rows