1

I want to get a created date of a column(not table) in PostgreSQL. I haven't found any information in "information_schema.columns". Any way to do so?

Aleksandr Zakharov
  • 334
  • 1
  • 4
  • 16
jean
  • 11
  • 2

1 Answers1

1

Direct answer

Postgresql metadata does not contains creation or modification dates of DB objects.

So direct answer: it's impossible to find it from information_schema or from postgresql metadata objects.

Some limited possibilities exists to find this information from other sources.

A. Logs

Check:

SHOW log_statement;

if it's not none - then it's possible to search in postgresql log ALTER TABLE command.

If logs were not recycled then you're in luck.

B. Exploring files of database

It schould be possible to get some information exploring files of database. But requires knowledge of postgresql storage file layout.

Look for inspiration here: https://stackoverflow.com/a/30308875/1168212

If you don't have to filesystem and/or superuser rights - then no luck.

Alex Yu
  • 3,412
  • 1
  • 25
  • 38