Re: CTID issues and a soc student in need of help

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: CTID issues and a soc student in need of help
Дата
Msg-id 20060601133008.GD12689@svana.org
обсуждение исходный текст
Ответ на CTID issues and a soc student in need of help  (Tzahi Fadida <tzahi.ml@gmail.com>)
Ответы Re: CTID issues and a soc student in need of help  (Tzahi Fadida <tzahi.ml@gmail.com>)
Список pgsql-hackers
On Thu, Jun 01, 2006 at 03:33:50PM +0300, Tzahi Fadida wrote:
> The question is, can the CTID field change throughout
> the run of my function due to some other processes working
> on the relation? Or because of command boundaries it is
> pretty much secured inside an implicit transaction?
> The problem wasn't so great if I didn't want to exploit
> indices in the relations (but I do and does), since
> after you issue a SELECT that uses indices, all you can rely on
> is the CTID to uniquely identify a tuple.

The CTID is the location on disk of the tuple, so no, it doesn't change
while you are running.

However, if you're running in isolation mode "read committed", then
someone else could update the tuple while you're looking at it. In this
case the tuple will appear to vanish and the updated version will
appear elsewhere with a new CTID. Whether this is a problem or not
depends on what you're using it for.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

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

Предыдущее
От: Tzahi Fadida
Дата:
Сообщение: CTID issues and a soc student in need of help
Следующее
От: Tzahi Fadida
Дата:
Сообщение: Re: CTID issues and a soc student in need of help