From: Nicolas Boisselier Date: Thu, 17 Oct 2024 20:29:42 +0000 (+0200) Subject: lib/postgres/host.sql X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=108f51d3d91a732f5202cdb7e9c5ac3182e026cb;p=nb.git lib/postgres/host.sql --- 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;