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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值