pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tgl@postgresql.org
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix LOCK TABLE to eliminate the race condition that could make it
Date: Tue, 12 May 2009 16:43:32 +0000 (UTC)
Message-ID: <20090512164332.BFC1575407D@cvs.postgresql.org> (raw)

Log Message:
-----------
Fix LOCK TABLE to eliminate the race condition that could make it give weird
errors when tables are concurrently dropped.  To do this we must take lock
on each relation before we check its privileges.  The old code was trying
to do that the other way around, which is a bit pointless when there are lots
of other commands that lock relations before checking privileges.  I did keep
it checking each relation's privilege before locking the next relation, which
is a detail that ALTER TABLE isn't too picky about.

Modified Files:
--------------
    pgsql/src/backend/access/heap:
        heapam.c (r1.274 -> r1.275)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/heap/heapam.c?r1=1.274&r2=1.27...)
    pgsql/src/backend/commands:
        lockcmds.c (r1.23 -> r1.24)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/lockcmds.c?r1=1.23&r2=1.24)
    pgsql/src/include/access:
        heapam.h (r1.141 -> r1.142)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/access/heapam.h?r1=1.141&r2=1.142)



view thread (7+ messages)  latest in thread

Message-ID: <20090512164332.BFC1575407D@cvs.postgresql.org>
Permalink:  ../20090512164332.BFC1575407D@cvs.postgresql.org/
Also on:    postgresql.org/message-id/20090512164332.BFC1575407D@cvs.postgresql.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-committers@postgresql.org
  Cc: tgl@postgresql.org
  Subject: Re: pgsql: Fix LOCK TABLE to eliminate the race condition that could make it
  In-Reply-To: <20090512164332.BFC1575407D@cvs.postgresql.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