From 108f51d3d91a732f5202cdb7e9c5ac3182e026cb Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 17 Oct 2024 22:29:42 +0200 Subject: [PATCH] lib/postgres/host.sql --- lib/postgres/host.sql | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/postgres/host.sql b/lib/postgres/host.sql index a5232d67..dd1351fb 100644 --- a/lib/postgres/host.sql +++ b/lib/postgres/host.sql @@ -4,8 +4,14 @@ CREATE VIEW host AS ,LEFT(CAST(MAX(updated) AS TEXT),19) as updated ,count(*) as infos -- ,array_to_string(array_agg(DISTINCT CASE WHEN key LIKE 'git.%.name' THEN val ELSE null END),' ') as installed + ,count(DISTINCT CASE WHEN key LIKE 'git.%.path' THEN val ELSE null END) as repos ,array_to_string(array_agg(DISTINCT CASE WHEN key LIKE 'git.%.branch' THEN val ELSE null END),' ') as branches - ,array_to_string(array_agg(DISTINCT CASE WHEN key IN ( 'sys.nproc','sys.arch','sys.width','sys.product' ) THEN val ELSE null END),chr(10)) as product + ,array_to_string(array_agg(DISTINCT CASE WHEN key IN ( 'sys.nproc','sys.arch','sys.model','sys.os' ) THEN val ELSE null END),chr(10)) as product + -- NB 17.10.24 ,array_to_string(array_agg(DISTINCT CASE WHEN key IN ( 'sys.nproc','sys.arch','sys.width','sys.product' ) THEN val ELSE null END),chr(10)) as product FROM host_info GROUP BY host + ORDER BY updated DESC,host ; +GRANT ALL PRIVILEGES ON host TO nico; +GRANT ALL PRIVILEGES ON host TO www; +GRANT ALL PRIVILEGES ON host TO root; -- 2.47.3