Re: Instability in TRUNCATE regression test - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Instability in TRUNCATE regression test
Date
Msg-id 20060628170416.GD17673@surnet.cl
Whole thread Raw
In response to Instability in TRUNCATE regression test  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Instability in TRUNCATE regression test  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:

> 1. Find a way to make the processing order consistent (eg by driving it
> off OID ordering).  Doesn't seem easy, but maybe I'm missing an idea.

Hmm, what about

1. get the complete list of tables to truncate, AccessShareLock'ed, get
their names
2. release locks
3. sort the list lexicographically (or by Oid, whatever)
4. acquire the stronger locks, in list order, taking care of not
aborting if a table is no longer there
5. truncate

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Thomas Hallgren
Date:
Subject: Fixed length datatypes. WAS [GENERAL] UUID's as primary keys
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Fixed length datatypes. WAS [GENERAL] UUID's as primary keys