Hi all,
How can I find the table creation time in Postgresql.
Example ,
If I created a file I can find the file creation time like that I want to know the table creation time.
Hi all,
How can I find the table creation time in Postgresql.
Example ,
If I created a file I can find the file creation time like that I want to know the table creation time.
I don't think it's possible from within PostgreSQL, but you'll probably find it in the underlying table file's creation time.
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;
select relname, relfilenode from pg_class;
<PostgreSQL folder>/main/base/<database id>/<table filenode id>
(not sure what it is on Windows).You can't - the information isn't recorded anywhere. Looking at the table files won't necessarily give you the right information - there are table operations that will create a new file for you, in which case the date would reset.