pg_查看錶的創建時間

這個表的創建時間是Dec 18

 

[postgres:5603@eimta] [04-02.11:30:31]=# \dcompany

                               Table "public.company"

Column|        Type         |                     Modifiers                      

--------+-----------------------+------------------------------------------------------

id    |integer              | not null default nextval('company_id_seq'::regclass)

name   |character varying(32) | not null

age   |integer              |

Indexes:

   "company_pkey" PRIMARY KEY, btree (id)

 

[postgres:5603@postgres] [04-02.11:17:09]=# \ceimta

You are now connectedto database "eimta" as user "postgres".

[postgres:5603@eimta] [04-02.11:17:16]=# selectrelname,relfilenode,reltablespace from pg_class where relname='company';

relname | relfilenode| reltablespace

---------+-------------+---------------

company|       17632|             0

(1 row)

 

Time: 12.704 ms

 

表 company 的 reltablespace值爲 0,表示位於所屬數據庫的默認表空間

[postgres:5603@eimta] [04-02.11:17:19]=# \dt+company

                    List of relations

Schema | Name   | Type  |   Owner   | Size  |Description

--------+---------+-------+-----------+-------+-------------

public | company |table | eimtadata | 16 kB |

(1 row)

 

 

Time: 0.836 ms

 

[postgres:5603@eimta] [04-02.11:18:18]=# selectoid,datname,dattablespace from pg_database where datname='eimta';

  oid  |datname | dattablespace

-------+---------+---------------

17532 |eimta   |          1663

(1 row)

 

Time: 0.431 ms

 

數據庫的oid 爲 17532

 

[postgres:5603@eimta] [04-02.11:19:18]=# selectoid,* from pg_tablespace where oid=1663;

oid  | spcname   | spcowner | spcacl | spcoptions

------+------------+----------+--------+------------

1663 | pg_default|       10|        |

(1 row)

 

[postgres@cnsz081771:eimta:5603/paic/pg5603/data/base]$ ls

1  13268 13269  16745  16746  17532

 

 

 

[postgres:5603@eimta] [04-02.11:20:04]=# \db

      List of tablespaces

   Name    |  Owner   | Location

------------+----------+----------

pg_default | postgres|

 pg_global | postgres |

 

 

[postgres@cnsz081771:eimta:5603/paic/pg5603/data/base/17532]$ ll 17632

-rw------- 1 postgrespostgres 8192 Dec 18 11:50 17632

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章