postgres=# select oid,* from pg_database;
oid | datname | datdba | encoding | datcollate | datctype | datistemplate | datallowconn | datconnlimit | datlastsysoid | datfrozenxid | datminmxid | dattablespace | datacl

-------+-----------+--------+----------+-------------+-------------+---------------+--------------+--------------+---------------+--------------+------------+---------------+--------------------------------------------------------
13212 | postgres | 10 | 6 | en_US.UTF-8 | en_US.UTF-8 | f | t | -1 | 13211 | 548 | 1 | 1663 |
16384 | nasa | 10 | 6 | en_US.UTF-8 | en_US.UTF-8 | f | t | -1 | 13211 | 548 | 1 | 1663 |
1 | template1 | 10 | 6 | en_US.UTF-8 | en_US.UTF-8 | t | t | -1 | 13211 | 548 | 1 | 1663 | {=c/postgres,postgres=CTc/postgres}
13211 | template0 | 10 | 6 | en_US.UTF-8 | en_US.UTF-8 | t | f | -1 | 13211 | 548 | 1 | 1663 | {=c/postgres,postgres=CTc/postgres}
24838 | db_nasa | 10 | 6 | en_US.UTF-8 | en_US.UTF-8 | f | t | -1 | 13211 | 548 | 1 | 1663 | {=Tc/postgres,postgres=CTc/postgres,u_nasa=C/postgres}
(5 rows)

postgres=# \q
[postgres@pgserver ~]$ cd $PGDATA
[postgres@pgserver data]$ ls
base logfile pg_dynshmem pg_ident.conf pg_multixact pg_replslot pg_snapshots pg_stat_tmp pg_tblspc PG_VERSION pg_xact postgresql.conf postmaster.pid
global pg_commit_ts pg_hba.conf pg_logical pg_notify pg_serial pg_stat pg_subtrans pg_twophase pg_wal postgresql.auto.conf postmaster.opts
[postgres@pgserver data]$ cd base
[postgres@pgserver base]$ ls -lrt
total 60
drwx------. 2 postgres postgres 8192 Aug 7 2017 1
drwx------. 2 postgres postgres 8192 Aug 7 2017 13211
drwx------. 2 postgres postgres 8192 Feb 24 11:52 13212
drwx------. 2 postgres postgres 8192 Feb 24 11:52 16384
drwx------ 2 postgres postgres 8192 Feb 24 11:53 24838 ---->>>注意这5个目录名字与上面的“select oid,* from pg_database”查询结果中 oid列 之间的关系
[postgres@pgserver base]$ pwd
/usr/local/pgsql/data/base
[postgres@pgserver base]$


OID列是隐藏属性(​​https://www.postgresql.org/docs/10/static/catalog-pg-database.html​​),

select * from pg_database是查不出来的,必须select oid  from pg_database 这么明确的指定oid

关于OID的更多知识,请参考 《PostgreSQL数据库内核分析》一书第15页。