select t.schemaname as db_schema, c.relname as table_name, t.tableowner as table_owner, c.relcreationtime as creationtime, * from pg_catalog.pg_class_info c left join pg_catalog.pg_namespace n ON c.relnamespace = n.oid left join pg_catalog.pg_tables t on c.relname = t.tablename where 1 = 1 --and t.tableowner like '%user_id' --and relname like '%revenues%' ;