Hi,
I was taking a look at _SHARED variable implementation of different
PLs and it looks like every PL implements its own ad-hoc method to
preserve cluster-wise data. Wouldn't it be beneficial to have a
cluster-wise table (sytem catalog?) which is accessible by any
procedure with required (superuser?) privileges? With such a table,
procedures (and PLs) will be able to preserve their state data
natively without need of any ad-hoc method and because of we're using
a just yet another plain table, all of the MVCC related stuff will be
handled by PostgreSQL easily.
Regards.