]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/pg.sh
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 31 Oct 2024 13:18:43 +0000 (14:18 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 31 Oct 2024 13:18:43 +0000 (14:18 +0100)
etc/profile.d/pg.sh
lib/postgres/host_report.sql

index 86c0c85f24c9c545d05419e44170d1edd00e8676..ab3c3e8d1e77c7578ff33974095f99d83ce204b7 100644 (file)
@@ -1,4 +1,10 @@
 which psql > /dev/null || return 0
+
+pg_pgpass_sql() {
+       local quote="'"
+       awk -F: '/^[:alpha:\*]/{print "ALTER USER "$4" WITH PASSWORD '$quote'"$5"'$quote';"}' ~/.pgpass
+}
+
 pg_count() { 
     declare dbs pwd tables length
 
index c1dcd0a6610d169e9275c9c1d04f61be9ea2022c..5ad12afee4cb6d9847e669dfb19cd4087cff5370 100644 (file)
@@ -10,8 +10,9 @@ CREATE VIEW host_report AS
                ,(SELECT MAX(hb.val) FROM host_info hb WHERE hb.key LIKE CONCAT('backup_servers.',hi.host,'.files_transfer')) as backup_files
        FROM host_info hi
        GROUP BY host
-       ORDER BY git_updated DESC,backup_updated DESC,host
+ORDER BY git_updated DESC,backup_updated DESC,host
 ;
 GRANT ALL PRIVILEGES ON host_report TO nico;
+GRANT ALL PRIVILEGES ON host_report TO icolas;
 GRANT ALL PRIVILEGES ON host_report TO www;
 GRANT ALL PRIVILEGES ON host_report TO root;