Add new function to convert 32-bit XID to 64-bit

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Add new function to convert 32-bit XID to 64-bit
Дата
Msg-id 0cb4de4b-42aa-bb8f-480f-a91c34c28cd0@oss.nttdata.com
обсуждение исходный текст
Ответы Re: Add new function to convert 32-bit XID to 64-bit  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Список pgsql-hackers
Hi,

When periodically collecting and accumulating statistics or status information like pg_locks, pg_stat_activity,
pg_prepared_xacts,etc for future troubleshooting or some reasons, I'd like to store a transaction ID of such
informationas 64-bit version so that the information of specified transaction easily can be identified and picked up by
transactionID. Otherwise it's not easy to distinguish transactions with the same 32-bit XID but different epoch, only
by32-bit XID.
 

But since pg_locks or pg_stat_activity etc returns 32-bit XID, we could not store it as 64-bit version. To improve this
situation,I'd like to propose to add new function that converts the given 32-bit XID (i.e., xid data type) to 64-bit
one(xid8 data type). If we do this, for example we can easily get 64-bit XID from pg_stat_activity by "SELECT
convert_xid_to_xid8(backend_xid)FROM pg_stat_activity", if necessary. Thought?
 

As another approach, we can change the data type of pg_stat_activity.backend_xid or pg_locks.transaction, etc from xid
toxid8. But this idea looks overkill to me, and it may break the existing applications accessing pg_locks etc. So IMO
it'sbetter to just provide the convertion function.
 

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



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

Предыдущее
От: "Euler Taveira"
Дата:
Сообщение: Re: pg_archivecleanup - add the ability to detect, archive and delete the unneeded wal files on the primary
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Add checkpoint and redo LSN to LogCheckpointEnd log message