1 Answer
- Newest
- Most votes
- Most comments
1
In my testing, I found that objects in pg_catalog, pg_toast, and information_schema do not have a creation time set. I also see that for views, there isn't a creation time set. Lastly, primary key constraints don't have a creation time. All other objects do have a creation time set.
select n.nspname, c.relkind, count(distinct c.relname)
from pg_class_info c
join pg_namespace n on c.relnamespace = n.oid
where c.relcreationtime is null
group by n.nspname, c.relkind
order by 1, 2;
v = view
r = ordinary table
i = index
s = sequence (only in pg_catalog)
t = toast table (only in pg_toast)
In my test database, I have the following object counts with null creation time.
nspname | relkind | count
--------------------+---------+-------
admin | v | 1
information_schema | r | 6
information_schema | v | 34
pg_catalog | i | 131
pg_catalog | r | 1155
pg_catalog | s | 1
pg_catalog | v | 656
pg_toast | i | 54
pg_toast | t | 54
public | i | 7
public | v | 7
tpcds | i | 23
tpcds | v | 4
(13 rows)
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 years ago

I ran the query you provided above with an additional filter for ordinary tables since that's primarily what I'm concerned with
And am getting this output, and there are some tables in the prod/google_analytics schemas do not have creation time.
By chance do you happen to know when Redshift started supporting PG_CLASS_INFO? Is it possible these tables are missing the creation time because they were created before PG_CLASS_INFO was established?
Can you examine the tables in "prod" without a creation time? I'm wondering if these are the tables that back a materialized view or maybe a table with an interleaved sort key.