Re: WIP: extensible enums

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WIP: extensible enums
Дата
Msg-id 23598.1287894367@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WIP: extensible enums  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: WIP: extensible enums  (Robert Haas <robertmhaas@gmail.com>)
Re: WIP: extensible enums  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I suppose you could fix this by always updating every row, and storing
> in each row the total count of elements (or a random number).  Then
> it'd be obvious if you'd read an inconsistent view of the world.

Well, the easy way to read a consistent view of the world is to load the
cache using an MVCC snapshot instead of SnapshotNow.  The current code
structure isn't amenable to that because it's relying on a syscache to
fetch the data for it, but that seems pretty inefficient anyway.  I'm
thinking of changing it around so that the enum cache gets loaded with
a regular systable_beginscan() scan, and then we could load with an
MVCC snapshot.

I'm kind of inclined to go to the float-based representation anyway,
though, just because not having to update other rows to do an insert
seems like a good thing.  But we could combine that with an MVCC
snapshot on the read side, which would make renumbering safe, which
would mean that we could auto-renumber when we ran out of code space
and not otherwise.  Is that getting too complicated?
        regards, tom lane


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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: WIP: extensible enums
Следующее
От: Robert Haas
Дата:
Сообщение: Re: patch: Add JSON datatype to PostgreSQL (GSoC, WIP)