为什么PostgreSQL没有一种简单可靠的方法来访问表创建时间? [英] WHY PostgreSQL have not a simple and reliable method to access table creation time?

查看:117
本文介绍了为什么PostgreSQL没有一种简单可靠的方法来访问表创建时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如问题的答案 PostgreSQL:表创建时间
以及类似的问题,
没有简单的方法来获取表的创建时间 ...控制,表管理或表审计(以及缓存系统等)的任务需要这个重要信息...那么,为什么PostgreSQL不提供简单直接的方法来获取它呢?不能使用内部系统表或编译标志来创建此字段(例如,在pg_class上)?

As showed by vage answers of the question PostgreSQL: Table creation time and similar questions, there are no simple way to get creation time of a table... Tasks for control, table administration or table audit (as well as cache systems and other ones) need this important information... So, WHY PostgreSQL not offer a simple and direct way to get it? Can not use a internal system table or a compile flag to create this field (at pg_class for example)?

推荐答案

PostgreSQL是一个社区驱动的开源项目。开发是由感兴趣的志愿者,为解决客户问题而付费的顾问以及出售PostgreSQL服务,希望使PostgreSQL对用户更具吸引力的公司混合而成。

PostgreSQL is a community-driven open source project. Development is by a mixture of interested volunteers, consultants paid to work on their customers' problems, and companies that sell PostgreSQL services who want to make PostgreSQL more attractive to users.

如果没有想要该功能的人愿意为开发付出代价,花时间自行开发补丁,或者向他们使用其服务的公司施加压力来开发该补丁,那么它就不会得到开发。

If nobody who wants the feature is willing to pay for its development, spend the time to develop the patch themselves, or pressure a company they use services from to develop it, it won't get developed.

除非您是潜在用户,否则可能希望登录以获取支持/服务,或者可以说服某人您的需求已由大量用户共享,那么您就不可能说服某人这样做。花费他们自己的付费商业开发人员时间。

Unless you're a prospective user who's likely to want to sign on for support / services, or can convince somebody that your need is shared by a large user base, it's not likely you'll convince someone to spend their own paid commercial developer time on it.

这是一种投入或……的情况。

This is a "put up or ..." kind of situation.

发生这种情况时,我正在考虑将其添加为用于PostgreSQL安全和审核的EU AXLE项目的一部分我参与其中。我还有其他紧迫的优先事项

As it happens I'm thinking about adding this as part of the EU AXLE project for PostgreSQL security and audit that I'm involved in. I have other pressing priorities first, though, so it won't be coming from me for quite some time.

大多数人登陆时都希望最后修改的 时间,而不仅仅是创造的时间。这要困难得多,因为它会强制每次提交都写入元数据。 Pg不能只使用磁盘上的修改时间,因为(a)每个表都有多个扩展区,并且(b)非用户活动,例如 VACUUM 和hint-位设置仍会写入表。我并不是要解决这个问题,到目前为止,我还没有看到有人愿意也愿意为此而努力。

Most people land up wanting the last-modified time, not just the created time. That's a lot harder because it forces a metadata write for every commit. Pg can't just use the on-disk modification time because (a) it has multiple extents for each table, and (b) non-user activity like VACUUM and hint-bit setting still writes to the table. It is not my intention to tackle that, and so far I haven't seen anybody who wants it who is also willing to do the work to make it happen.

(我将其标记为社区Wiki,因为它并不是真正的问题与解答,我将对此问题进行投票)。

(I've marked this "Community Wiki" since it's not really Q&A, and I'm close-voting this question).

这篇关于为什么PostgreSQL没有一种简单可靠的方法来访问表创建时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆