Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

NameTypeDefaultNullable
api_versiontexttrue
postgistexttrue
postgresttexttrue
sys_versiontexttrue
timescaledbtexttrue

Referenced Tables

NameColumnsCommentType
pg_extension0
pg_stat_activity0
public.app_settings2application settingsBASE TABLE

Relations

erDiagram


"api.versions_view" {
  text api_version ""
  text postgis ""
  text postgrest ""
  text sys_version ""
  text timescaledb ""
}

Generated by tbls