Re: Locking rows

From: Neil Conway <neilc(at)samurai(dot)com>
To: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
Cc: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Locking rows
Date: 2003-02-28 15:08:46
Message-ID: 1046444926.430.90.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)samurai(dot)com> || PGP Key ID: DB3C29FC

In response to

  • Locking rows at 2003-02-28 10:26:55 from Jean-Christian Imbeault

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2003-02-28 15:10:54 Re: 7.4?
Previous Message evon600c 2003-02-28 14:52:22 Re: how to determine OID of the row I just inserted???