使用oid2name列出数据库和对应的oid

[postgres@postgre base]$ ll
total 172
drwx------ 2 postgres postgres 12288 Dec  6 09:21 1
drwx------ 2 postgres postgres 12288 Dec  6 09:21 13877
drwx------ 2 postgres postgres 12288 Dec 20 23:04 13878
drwx------ 2 postgres postgres 69632 Dec 23 14:47 16384
drwx------ 2 postgres postgres 20480 Dec 23 14:52 16385
drwx------ 2 postgres postgres 16384 Dec 23 11:35 16386
drwx------ 2 postgres postgres 12288 Dec 23 09:28 177797
drwx------ 2 postgres postgres 12288 Dec 22 21:20 866029
drwx------ 2 postgres postgres  4096 Dec 23 15:23 pgsql_tmp
[postgres@postgre base]$ oid2name
All databases:
     Oid  Database Name  Tablespace
-----------------------------------
  177797       abceport  pg_default
   13878       postgres  pg_default
   13877      template0  pg_default
       1      template1  pg_default
   16386           abbm  pg_default
   16384           abep  pg_default
   16385          abprv  pg_default
  866029            abp  pg_default

  

原文地址:https://www.cnblogs.com/abclife/p/12084141.html