Re: TRUNCATE SERIALIZABLE and frozen COPY

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Kevin Grittner <kgrittn(at)mail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Marti Raudsepp <marti(at)juffo(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: TRUNCATE SERIALIZABLE and frozen COPY
Date: 2012-11-09 15:18:29
Message-ID: CA+U5nMLXrM_mxkd_gU7KaVFbDox4YUYRpsACeeYKqgCad7MRow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 9 November 2012 14:22, Kevin Grittner <kgrittn(at)mail(dot)com> wrote:
> Robert Haas wrote:
>
>> What I've been wondering since this last came up is whether we
>> could use some variant of the SIREAD locks Kevin introduced for SSI
>> to handle this case - essentially have the transaction doing the
>> TRUNCATE make an entry in the lock table that will force a
>> serialization failure for any backend which accesses the table with
>> a snapshot that can't see the truncating transaction's XID.
>
> It seems to me that the goal would be to make this semantically
> idential to the behavior users would see if an unqualified DELETE
> were run against the table rather than a TRUNCATE.

Unqualified DELETE already runs that way. TRUNCATE is a different
command for a reason. Making TRUNCATE like something we already have
seems not very useful to me, not least because it breaks existing
applications.

> This seems like a subset of the issues which one might want to
> address by making DDL statement behave in a more strictly MVCC
> fashion. Does it make sense to pick those off one at a time, or
> should something like this be done only in the context of an overall
> plan to deal with all of it?

TRUNCATE is not DDL, plus I have no interest in this other than
speeding up COPY.

Scope creep just kills features.

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2012-11-09 15:24:09 Re: TRUNCATE SERIALIZABLE and frozen COPY
Previous Message Robert Haas 2012-11-09 15:18:05 Re: WIP checksums patch