pgrgraphic
pgrgraphic · PL/R-based PostgreSQL extension that renders database query results as PNG or JPEG chart files.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100648 | pgrgraphic | pgrgraphic | 1.0.0 | UTIL | Unknown | R |
| Relationships | |
|---|---|
| Requires | plr |
Usage
Sources:
pgrgraphic is an old PL/R extension that renders PostgreSQL query results to PNG or JPEG chart files on the database server. It covers bars, lines, points, histograms, contours, heat maps, box plots, and pie charts. It is tied to a PostgreSQL 9.x, R, PL/R, and X-server-era environment and is unsafe for untrusted use.
Core Workflow
After the server administrator installs R, PL/R, lattice, gplots, and a suitable graphics environment, a trusted user can pass a SQL text query to a chart wrapper:
The function writes a file below the PostgreSQL operating-system account’s home or working directory and returns text; upstream uses 10 as its success marker.
Important Objects
grafica_barras_simplesandgrafica_barras_multiplesrender bar charts.grafica_lineas,grafica_lineas_puntos, andgrafica_puntosrender line and point charts.grafica_histogramaandgrafica_histograma_3drender histograms.grafica_caja,grafica_contorno,grafica_dispersion,grafica_mapa_de_calor, andgrafica_piecover other chart forms.- The parallel
r_*functions are the PL/R implementations behind the SQL wrappers.
Security and Operational Notes
PL/R is untrusted, and pgrgraphic accepts executable SQL text and writes arbitrary chart names through the database-server account. Do not grant these functions to untrusted roles. The installation SQL hard-codes the pgrgraphic schema and ownership by postgres, which can fail or create surprising ownership. Files are not lifecycle-managed and can fill the server disk. Prefer exporting query data to a separately sandboxed visualization service.