VARDATA_COMPRESSED_GET_COMPRESS_METHOD comment?

Поиск
Список
Период
Сортировка
От Christoph Berg
Тема VARDATA_COMPRESSED_GET_COMPRESS_METHOD comment?
Дата
Msg-id YTeLipdnSOg4NNcI@msg.df7cb.de
обсуждение исходный текст
Ответы Re: VARDATA_COMPRESSED_GET_COMPRESS_METHOD comment?  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
In postgres.h, there are these macros for working with compressed
toast:

                                                  vvvvvvvv
/* Decompressed size and compression method of an external compressed Datum */
#define VARDATA_COMPRESSED_GET_EXTSIZE(PTR) \
    (((varattrib_4b *) (PTR))->va_compressed.va_tcinfo & VARLENA_EXTSIZE_MASK)
#define VARDATA_COMPRESSED_GET_COMPRESS_METHOD(PTR) \
    (((varattrib_4b *) (PTR))->va_compressed.va_tcinfo >> VARLENA_EXTSIZE_BITS)

/* Same, when working directly with a struct varatt_external */
#define VARATT_EXTERNAL_GET_EXTSIZE(toast_pointer) \
    ((toast_pointer).va_extinfo & VARLENA_EXTSIZE_MASK)
#define VARATT_EXTERNAL_GET_COMPRESS_METHOD(toast_pointer) \
    ((toast_pointer).va_extinfo >> VARLENA_EXTSIZE_BITS)


On the first line, is the comment "external" correct? It took me quite
a while to realize that the first two macros are the methods to be
used on an *inline* compressed Datum, when the second set is used for
varlenas in toast tables.

Context: Me figuring out https://github.com/credativ/toastinfo/blob/master/toastinfo.c#L119-L128

Christoph



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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert
Следующее
От: Amul Sul
Дата:
Сообщение: Re: [Patch] ALTER SYSTEM READ ONLY