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)?
-
2I don't think that a "why" question like this is a good fit for SO. There are already questions (like the one you linked) about the "how", which is more suitable. – Jim Stewart Jan 13 '14 at 00:33
-
The "why" is different and is not covered by the "how": see @CraigRinger's answer to understand. The "why" is necessary for any programmer that need to check how decision-making process are in nowadays, or if there are any historic rationale for that decision (both not covered by guides and manuals). – Peter Krauss Jan 13 '14 at 02:13
-
@JimStewart Agreed, and I'm closevoting for that reason, with an answer marked CW since I think it's worth addressing even if it's OT. – Craig Ringer Jan 13 '14 at 02:33
2 Answers
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.
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.
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.
(I've marked this "Community Wiki" since it's not really Q&A, and I'm close-voting this question).

- 307,061
- 76
- 688
- 778
-
I think community decisions "driven by email" in general is not so good as a objective document for "open public consultations", like RFC. More interactive and objective is also something like Stackoverflow.com (see http://askbot.org/). I see, at last years of "pgsql-hackers forum"(email list), that decisions of requeriments are expressed only by programmers/developpers, not by all [stakeholders](https://en.wikipedia.org/wiki/Stakeholder_(corporate)). – Peter Krauss Jan 13 '14 at 02:04
-
About AXLE project, seems so good, thanks to the link (!). I have a project for [PostGIS2](http://postgis.org/) that is an audit and a "bugtracker for geometries" system... Perhaps something of AXLE can be reused in our project. – Peter Krauss Jan 13 '14 at 02:18
-
@PeterKrauss Whatever results from the AXLE project will make its way into public PostgreSQL and other tools eventually. It's not a software project its self. – Craig Ringer Jan 13 '14 at 02:29
-
@PeterKrauss BTW, I agree with you that -hackers can be a bit of a closed, self-reinforcing world. I think it's unhealthy, and it's causing long standing user problems (can you say "upsert") to be ignored, and decent solutions rejected because they're not "perfect" to solve an urgent user problem. If you want to make a difference, then (a) make noise where it'll get heard, and (b) *contribute your time and effort*. – Craig Ringer Jan 13 '14 at 02:31
A main reason is simple - we (PostgreSQL developers) doesn't find a agreement how to implement this feature (and what this feature should to do). Now, after years of discussion there is simple solution available - every body can use "EVENT TRIGGERS" (PostgreSQL 9.3) and can implement this functionality how it needs.

- 42,331
- 5
- 91
- 94
-
Thanks, "EVENT TRIGGERS" is a good news! (my pg-server using pg9.2.4 near future will be 9.3 and I will try it). I can not change `pg_class`, only do a inner join by `oid` on a table... I am using "pg_extra" as table name. **Sub-question**: there are a good "standard name" (or a "popular name" used in a popular project), for recording "created date" column? – Peter Krauss Jan 13 '14 at 10:48
-
@PeterKrauss - is not best practice use names similar to system tables for custom tables. Is good to know what is buitin, and what is customized objects. Some typical names: atime, mtime, ctime. – Pavel Stehule Jan 13 '14 at 11:50