Have a look at PL/R. You can embed a command to generate a graphic using R via a user defined SQL function, This example from http://www.varlena.com/GeneralBits/Tidbits/bernier/art_66/graphingWithR.html HTH Brent Wood ===================================================================================== Graphs can be as easy as '123'. Here's an example where two columns in a table are plotted against each other. Create and populate the table using the following commands:
The function f_graph() generates the graph as a pdf document:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Craig Ringer said: Now, personally, if we're talking "database innovation" what I'd like to see is a built-in way to get query results straight from the database as graphs of tuples and their relationships. Tabular result sets are poorly suited to some kinds of workloads, including a few increasingly common ones like document-oriented storage and use via ORMs. In particular, the way ORMs tend to do multiple LEFT OUTER JOINs and deduplicate the results or do multiple queries and post-process to form a graph is wasteful and slow. If Pg had a way to output an object graph (or at least tree) natively as, say, JSON, that'd be a marvellous option for some kinds of workloads, and might help the NoSQL folks from whining quite so much as well ;-) -- Craig Ringer Tech-related writing at http://soapyfrogs.blogspot.com/ -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general Brent Wood DBA/GIS consultant NIWA, Wellington New Zealand
Please consider the environment before printing this email.
NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd. |