Re: tuptoaster.c must *not* use SnapshotAny

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: tuptoaster.c must *not* use SnapshotAny
Дата
Msg-id 2687.1011323548@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: tuptoaster.c must *not* use SnapshotAny  (Hiroshi Inoue <Inoue@tpf.co.jp>)
Ответы Re: tuptoaster.c must *not* use SnapshotAny  (Jan Wieck <janwieck@yahoo.com>)
Список pgsql-hackers
Hiroshi Inoue <Inoue@tpf.co.jp> writes:
> The same snapshot for both the main and the toast table
> seems better though I don't know how it's difficult to
> change.

That would be cleaner but I don't see any way to do it.  The toasted
value gets passed all over the system, potentially, before someone asks
to detoast it.  At that point you really don't have a good way to know
which snapshot was used to fetch the main-table row.

> For example is it possible to update a toast
> chunk partially using SnapshotToast ?

As things stand (with either SnapshotToast or the old SnapshotAny way)
it is never possible to update an individual toast value, either
partially or wholly.  All you can do is lay down a new toast value (with
a new identifying OID) and then delete the old one.

But I'm not sure that this is wrong, or fixable.  Trying to update part
of a toasted value is very much like wanting to update part of an
existing row in-place, which we cannot possibly do.  We have to lay down
a whole new row whenever any part of it is updated.
        regards, tom lane


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

Предыдущее
От: Hiroshi Inoue
Дата:
Сообщение: Re: tuptoaster.c must *not* use SnapshotAny
Следующее
От: Philip Warner
Дата:
Сообщение: Re: Bug in pg_dump/restore -o