Re: Must be owner to truncate?

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Must be owner to truncate?
Дата
Msg-id 20050707212713.GM24207@ns.snowman.net
обсуждение исходный текст
Ответ на Re: Must be owner to truncate?  (Andrew - Supernews <andrew+nonews@supernews.com>)
Ответы Re: Must be owner to truncate?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Must be owner to truncate?  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-hackers
* Andrew - Supernews (andrew+nonews@supernews.com) wrote:
> On 2005-07-07, Stephen Frost <sfrost@snowman.net> wrote:
> >
> >>  * truncate is not MVCC-safe.
> >
> > Erm, that's why it gets a stronger lock, so I don't really see what
> > this has to do with it.
>
> It's not MVCC-safe even with the AccessExclusive lock; it damages snapshots
> that were taken before the truncate operation but which don't have a lock
> on the table yet. The only reason it doesn't break pg_dump is that the
> first thing that pg_dump does is to take AccessShare locks on every table
> that it's going to dump.

This seems like something which should probably be fixed, but which is
probably too late to fix for 8.1.  Of course, if we could fix this then
it seems like it would be possible for us to just change 'delete from x'
to behave as truncate does now given appropriate conditions.  I'm not as
familiar with that area as others are; is this a very difficult thing to
do?  If not then I may take a look at it, it'd be a very nice
improvement.
Thanks,
    Stephen

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Must be owner to truncate?
Следующее
От: "Rodrigo Moreno"
Дата:
Сообщение: Pg_autovacuum on FreeBSD