PostgreSQL:表创建时间

编程入门 行业动态 更新时间:2024-10-28 12:20:49
本文介绍了PostgreSQL:表创建时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何在Postgresql中查找表创建时间.

How can I find the table creation time in Postgresql.

示例

如果创建了文件,我可以找到文件创建时间,就像我想知道表创建时间一样.

If I created a file I can find the file creation time like that I want to know the table creation time.

推荐答案

我浏览了pg_ *表,但在那里找不到任何创建时间.可以找到表文件,但是在Linux上您无法获得文件创建时间.因此,我认为答案是,您只能通过以下步骤在Windows上找到此信息:

I had a look through the pg_* tables, and I couldn't find any creation times in there. It's possible to locate the table files, but then on Linux you can't get file creation time. So I think the answer is that you can only find this information on Windows, using the following steps:

  • 使用select datname, datdba from pg_database;
  • 获取数据库ID
  • 使用select relname, relfilenode from pg_class;
  • 获取表filenode ID
  • 查找表文件并查找其创建时间;我认为该位置应类似于<PostgreSQL folder>/main/base/<database id>/<table filenode id>(不确定Windows上的位置).
  • get the database id with select datname, datdba from pg_database;
  • get the table filenode id with select relname, relfilenode from pg_class;
  • find the table file and look up its creation time; I think the location should be something like <PostgreSQL folder>/main/base/<database id>/<table filenode id> (not sure what it is on Windows).

更多推荐

PostgreSQL:表创建时间

本文发布于:2023-07-20 22:15:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1171566.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:时间   PostgreSQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!