Hi! I like the idea of having a standard function which shows a TOAST value ID for a row. I've used my own to handle TOAST errors. Just, maybe, more correct name would be "...value_id", because you actually retrieve valueid field from the TOAST pointer, and chunk ID consists of valueid + chunk_seq.
-- Regards, Nikita Malakhov Postgres Professional The Russian Postgres Company https://postgrespro.ru/