Re: pg_filedump 9.3: checksums (and a few other fixes)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: pg_filedump 9.3: checksums (and a few other fixes)
Дата
Msg-id 20130610052810.GE15368@eldon.alvh.no-ip.org
обсуждение исходный текст
Ответ на pg_filedump 9.3: checksums (and a few other fixes)  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: pg_filedump 9.3: checksums (and a few other fixes)  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
Jeff Davis wrote:

> --- 1000,1015 ----
>           strcat (flagString, "HASEXTERNAL|");
>         if (infoMask & HEAP_HASOID)
>           strcat (flagString, "HASOID|");
> +       if (infoMask & HEAP_XMAX_KEYSHR_LOCK)
> +         strcat (flagString, "XMAX_KEYSHR_LOCK|");
>         if (infoMask & HEAP_COMBOCID)
>           strcat (flagString, "COMBOCID|");
>         if (infoMask & HEAP_XMAX_EXCL_LOCK)
>           strcat (flagString, "XMAX_EXCL_LOCK|");
> !       if (infoMask & HEAP_XMAX_SHR_LOCK)
> !         strcat (flagString, "XMAX_SHR_LOCK|");
> !       if (infoMask & HEAP_XMAX_LOCK_ONLY)
> !         strcat (flagString, "XMAX_LOCK_ONLY|");
>         if (infoMask & HEAP_XMIN_COMMITTED)
>           strcat (flagString, "XMIN_COMMITTED|");
>         if (infoMask & HEAP_XMIN_INVALID)

Hm, note that XMAX_SHR_LOCK is two bits, so when that flag is present
you will get the three lock modes displayed with the above code, which is
probably going to be misleading.  htup_details.h does this:

/** Use these to test whether a particular lock is applied to a tuple*/
#define HEAP_XMAX_IS_SHR_LOCKED(infomask) \(((infomask) & HEAP_LOCK_MASK) == HEAP_XMAX_SHR_LOCK)
#define HEAP_XMAX_IS_EXCL_LOCKED(infomask) \(((infomask) & HEAP_LOCK_MASK) == HEAP_XMAX_EXCL_LOCK)
#define HEAP_XMAX_IS_KEYSHR_LOCKED(infomask) \(((infomask) & HEAP_LOCK_MASK) == HEAP_XMAX_KEYSHR_LOCK)

Presumably it'd be better to do something similar.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Eliminating PD_ALL_VISIBLE, take 2
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: pg_filedump 9.3: checksums (and a few other fixes)