pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martijn van Oosterhout <kleptog@svana.org>
To: Dave Cramer <pg@fastcrypt.com>
Cc: Jens Schipkowski <jens.schipkowski@apus.co.at>
Cc: Joost Kraaijeveld <J.Kraaijeveld@askesis.nl>
Cc: pgsql-general@postgresql.org
Cc: pgsql-performance@postgresql.org
Subject: Re: [PERFORM] Locking in PostgreSQL?
Date: Wed, 6 Dec 2006 14:45:27 +0100
Message-ID: <20061206134527.GA11211@svana.org> (raw)
In-Reply-To: <4ED560E4-3484-43BA-99BB-18888D968F74@fastcrypt.com>
References: <1165388652.6396.1.camel@panoramix>
	<30BD1C9A-1664-4290-B343-0FB1FEBA7B53@fastcrypt.com>
	<op.tj43bqe481rjf6@xjens.apus.local>
	<4ED560E4-3484-43BA-99BB-18888D968F74@fastcrypt.com>

On Wed, Dec 06, 2006 at 08:26:45AM -0500, Dave Cramer wrote:
> >>Unless you specifically ask for it postgresql doesn't lock any  
> >>rows when you update data.
> >>
> >Thats not right. UPDATE will force a RowExclusiveLock to rows  
> >matching the WHERE clause, or all if no one is specified.
> 
> Apparently I've completely misunderstood MVCC then.... My  
> understanding is that unless you do a select ... for update then  
> update the rows will not be locked .

I think it comes down to what you mean by RowExclusiveLock. In MVCC,
writers don't block readers, so even if someone executes an update on a
row, readers (SELECT statements) will not be blocked.

So it's not a lock as such, more a "I've updated this row, go find the
new version if that's appropriate for your snapshot".

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachments:

  signature.asc (application/pgp-signature, 188B) download

view thread (10+ messages)  latest in thread

Message-ID: <20061206134527.GA11211@svana.org>
Permalink:  ../20061206134527.GA11211@svana.org/
Also on:    postgresql.org/message-id/20061206134527.GA11211@svana.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: kleptog@svana.org, pg@fastcrypt.com, jens.schipkowski@apus.co.at, J.Kraaijeveld@askesis.nl, pgsql-general@postgresql.org
  Subject: Re: [PERFORM] Locking in PostgreSQL?
  In-Reply-To: <20061206134527.GA11211@svana.org>

* 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