PostgreSQLでdb、tableオーナーを確認する
dbオーナー確認
Owner列を確認
code: (sh)
psql -l
PostgreSQLロール(ユーザ)確認
デフォルトのposgresユーザで確認する
code: (sh)
psql -U postgres -c '\du'
or
sudo -u postgres psql -c '\du'
全tableのオーナー確認
pg_tableの全情報を出力
情報が多いのでlessで見る必要がある
code: (sh)
psql {db_name} -c "
SELECT
tablename,
tableowner
FROM pg_tables
WHERE schemaname='public'
ORDER BY tableowner, tablename;
"
tableオーナーのみ確認
pg_tableからオーナーのみを抽出
code: (sh)
psql {db_name} -c "
SELECT DISTINCT tableowner
FROM pg_tables
WHERE schemaname='public';
#DB
#PostgreSQL