pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Jean-Christian Imbeault <jc@mega-bucks.co.jp>
To: PostgreSQL-general <pgsql-general@postgresql.org>
Subject: Re: Locking rows
Date: Fri, 28 Feb 2003 15:27:40 +0000
Message-ID: <200302281527.40316.dev@archonet.com> (raw)
In-Reply-To: <3E5F396F.4090507@mega-bucks.co.jp>
References: <3E5F396F.4090507@mega-bucks.co.jp>

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



view thread (19+ messages)  latest in thread

Message-ID: <200302281527.40316.dev@archonet.com>
Permalink:  ../200302281527.40316.dev@archonet.com/
Also on:    postgresql.org/message-id/200302281527.40316.dev@archonet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: dev@archonet.com, jc@mega-bucks.co.jp
  Subject: Re: Locking rows
  In-Reply-To: <200302281527.40316.dev@archonet.com>
  References: <3E5F396F.4090507@mega-bucks.co.jp> <200302281527.40316.dev@archonet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox