短いTIPSなので、さっそく本題に。
psql -d "postgres" -h {host} -U postgres
SELECT
d.datname AS "Name",
a.rolname AS "Owner",
pg_encoding_to_char(d.encoding) AS "Encoding",
d.datcollate AS "Collation",
d.datctype AS "Ctype",
d.datacl AS "Access privileg"
FROM pg_database d
JOIN pg_authid a ON a.OID = d.datdba
;
こんな感じでリストが取得できるはずです。
Name | Owner | Encoding | Collation | Ctype | Access privileges |
---|---|---|---|---|---|
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | |
template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | {=c/postgres,postgres=CTc/postgres} |
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | {=c/postgres,postgres=CTc/postgres} |
ではでは。