]> git.nbdom.net Git - nb.git/commitdiff
fix databases
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 7 Oct 2024 10:44:39 +0000 (11:44 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 7 Oct 2024 10:44:39 +0000 (11:44 +0100)
lib/php/db/types/pgsql.php

index d0bb9b7cbc9b496137c3b63aa99023c2eec271b7..b49b3f0367da1225669cc9734f0102c754c258c8 100644 (file)
@@ -24,9 +24,9 @@ $DB_TYPES['pgsql'] = array (
 
 'localFile' => array (getenv('HOME').'/.pgpass','^[^:]+:[^:]+:<D.NAME>:(?P<user>[^:]+):(?<password>[^:]+)'),
 
-'databases' => 'SELECT datname as name,pg_catalog.pg_get_userbyid(datdba) as owner,pg_catalog.pg_encoding_encoding) as encoding, datcollate as "collate",datctype as "Ctype" FROM pg_catalog.pg_database',
+'databases' => 'SELECT datname as name,pg_catalog.pg_get_userbyid(datdba) as owner,pg_catalog.pg_encoding_to_char(encoding) as encoding, datcollate as "collate",datctype as "Ctype" FROM pg_catalog.pg_database',
+# NB 07.10.24 BUG 'databases' => 'SELECT datname as name,pg_catalog.pg_get_userbyid(datdba) as owner,pg_catalog.pg_encoding_encoding) as encoding, datcollate as "collate",datctype as "Ctype" FROM pg_catalog.pg_database',
 
-# NB 10.01.18 'tables' => "SELECT table_name as name,LOWER(CASE table_type WHEN 'BASE TABLE' THEN 'TABLE' ELSE table_type END) as type,table_type FROM information_schema.tables WHERE table_type in('BASE TABLE','VIEW') AND table_schema = 'public'",
 'tables' => "SELECT table_name as name,LOWER(CASE table_type WHEN 'BASE TABLE' THEN 'TABLE' ELSE table_type END) as type FROM information_schema.tables WHERE table_type in('BASE TABLE','VIEW') AND table_schema = 'public'",
 
 'table.sql.create' => function($sql) {