Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Add checks to TRUNCATE, CLUSTER, and REINDEX to prevent

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add checks to TRUNCATE, CLUSTER, and REINDEX to prevent
Date: 2008-01-31 03:50:28
Message-ID: 200801310350.m0V3oSa09256@momjian.us (view raw or flat)
Thread:
Lists: pgsql-committers
Tom Lane wrote:
> Log Message:
> -----------
> Add checks to TRUNCATE, CLUSTER, and REINDEX to prevent performing these
> operations when the current transaction has any open references to the
> target relation or index (implying it has an active query using the relation).
> The need for this was previously recognized in connection with ALTER TABLE,
> but anything that summarily eliminates tuples or moves them around would
> confuse an active scan.
> 
> While this patch does not in itself fix bug #3883 (the deadlock would happen
> before the new check fires), it will discourage people from attempting the
> sequence of operations that creates a deadlock risk, so it's at least a
> partial response to that problem.
> 
> In passing, add a previously-missing check to REINDEX to prevent trying to
> reindex another backend's temp table.  This isn't a security problem since
> only a superuser would get past the schema permission checks, but if we are
> testing for this in other utility commands then surely REINDEX should too.

You want a TODO for 3883?

-- 
  Bruce Momjian  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-committers by date

Next:From: Tom LaneDate: 2008-01-31 05:49:13
Subject: Re: pgsql: Add checks to TRUNCATE, CLUSTER, and REINDEX to prevent
Previous:From: Andrew DunstanDate: 2008-01-31 03:26:15
Subject: pgsql: Fix test that wrongly excluded some dumpbin symbols.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group