'-c"SELECT datname, coalesce(usename, (select usename from pg_shadow where usesysid=(select datdba from pg_database where datname='template0'))), pg_encoding_to_char(d.encoding), datistemplate, datpath FROM pg_database d LEFT JOIN pg_shadow u ON (datdba = usesysid) WHERE datallowconn ORDER BY 1;" | \
while read DATABASE ;do
IFS="$NL"
read DBOWNER
read ENCODING
read ISTEMPLATE
read DBPATH
IFS="$_IFS"
if["$DATABASE"!= template1 ];then
echo
...
...
@@ -251,7 +264,10 @@ done
$PSQL-d template1 -At-F'
'-c"SELECT datname FROM pg_database WHERE datallowconn ORDER BY 1;" | \