Re: Locking rows - Mailing list pgsql-general

From Neil Conway
Subject Re: Locking rows
Date
Msg-id 1046444926.430.90.camel@tokyo
Whole thread Raw
In response to Locking rows  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
List pgsql-general
On Fri, 2003-02-28 at 05:26, 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.

Is that a problem? ISTM that if you need to keep the DB consistent
during the entire print job, you're going to get pretty poor concurrent
performance regardless.

> I've read the iDocs and Bruce's online manual but can seem to find any
> info on the syntax for locking other that for SELECT FOR UPDATE. And
> even then the docs don't state how to remove the lock created by a
> SELECT FOR UPDATE.

The docs on FOR UPDATE say:

This prevents them from being modified or deleted by other transactions
until the current transaction ends; that is, other transactions that
attempt UPDATE, DELETE, or SELECT FOR UPDATE of these rows will be
blocked until the current transaction ends.

Cheers,

Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC




pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Locking rows
Next
From: Jonathan Bartlett
Date:
Subject: Re: Few Simple Questions