SnapshotNow == (Snapshot) NULL, seems bad

Поиск
Список
Период
Сортировка
От Tom Lane
Тема SnapshotNow == (Snapshot) NULL, seems bad
Дата
Msg-id 3512.1094434958@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
With the current definitions of the "special" snapshot values:

#define SnapshotNow                  ((Snapshot) 0x0)
#define SnapshotSelf                 ((Snapshot) 0x1)
#define SnapshotAny                  ((Snapshot) 0x2)
#define SnapshotToast                ((Snapshot) 0x3)

it is not possible to distinguish SnapshotNow from (Snapshot) NULL,
and in particular there is no unique representation defined for an
"invalid" snapshot.  This has not caused problems to date, but it
seems inevitable that it will rise up and bite us someday.  Does
anyone object to revising these values to be 0x1-0x4 respectively,
and adding "InvalidSnapshot" #defined to 0?

This change would force a backend-wide recompile, and possibly force
recompiling some external C functions, but not have any wider effect
than that AFAICS.

I have an ulterior motive here, which is that in connection with
the discussions about changing SetQuerySnapshot behavior, I am looking
at some internal API changes for which it would be convenient to have
an InvalidSnapshot value ...
        regards, tom lane


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

Предыдущее
От: Rod Taylor
Дата:
Сообщение: Re: AIX and v8 beta1
Следующее
От: Reini Urban
Дата:
Сообщение: Re: APR 1.0 released