External Tabular Data Via SQL

From: David Fetter <david(at)fetter(dot)org>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: External Tabular Data Via SQL
Date: 2004-10-03 22:22:57
Message-ID: 20041003222257.GB28559@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

Attachment Content-Type Size
pg_ps.sql text/plain 4.4 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-10-03 22:37:44 Re: Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd timestamp index possible?)
Previous Message Greg Stark 2004-10-03 21:49:32 Re: Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd timestamp index possible?)