Help Center/ GaussDB/ Distributed_8.x/ FAQs/ How do I view the creation time of a table?
Updated on 2024-06-03 GMT+08:00

How do I view the creation time of a table?

Answer: See the value of the created column in the PG_TABLES system view.

-- Create a table.
gaussdb=# CREATE TABLE test(id int, name varchar(10));

-- Query the time when the test table is created.
gaussdb=# SELECT tablename,created FROM pg_tables WHERE tablename = 'test';
 tablename |            created            
-----------+-------------------------------
 test      | 2024-01-12 14:50:59.611988+08
(1 row)