api.versions_view
Description
Expose as a table view app and system version to API
Table Definition
CREATE VIEW versions_view AS (
SELECT value AS api_version,
rtrim("substring"(version(), 0, 17)) AS sys_version,
( SELECT pg_extension.extversion AS timescaledb
FROM pg_extension
WHERE (pg_extension.extname = 'timescaledb'::name)) AS timescaledb,
( SELECT pg_extension.extversion AS postgis
FROM pg_extension
WHERE (pg_extension.extname = 'postgis'::name)) AS postgis,
( SELECT rtrim("substring"(pg_stat_activity.application_name, 'PostgREST [0-9.]+'::text)) AS postgrest
FROM pg_stat_activity
WHERE (pg_stat_activity.application_name ~~* '%postgrest%'::text)
LIMIT 1) AS postgrest
FROM app_settings
WHERE (name = 'app.version'::text)
)
Columns
| Name | Type | Default | Nullable |
|---|---|---|---|
| api_version | text | true | |
| postgis | text | true | |
| postgrest | text | true | |
| sys_version | text | true | |
| timescaledb | text | true |
Referenced Tables
| Name | Columns | Comment | Type |
|---|---|---|---|
| pg_extension | 0 | ||
| pg_stat_activity | 0 | ||
| public.app_settings | 2 | application settings | BASE TABLE |
Relations
erDiagram
"api.versions_view" {
text api_version ""
text postgis ""
text postgrest ""
text sys_version ""
text timescaledb ""
}
Generated by tbls