Kind people,
Please find enclosed an example of what I hope to make into a
generalized way of accessing external tabular data via SQL.
It is written in PL/PerlU for portability reasons, although it could
probably be re-written in C at the cost of some large amount of
effort. It depends on having Proc::ProcessTable installed.
init_ps() makes a process_table_type using Proc::ProcessTable.
get_ps() takes no arguments and returns a setof process_table_type,
and can be joined to, for example, pg_stat_activity.
Many thanks and kudos to Andrew Dunstan for helping me figure out the
niggly details.
This should go into a new section of contrib/ like sql_utils or some
such.
Big TIA for any hints, tips or pointers, especially to things I've
missed here. :)
Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778
Remember to vote!