Skip to main content

system.databases_with_history

Introduced: v1.1.658

Records all databases, including active and dropped ones. It shows each database's catalog, name, unique ID, owner (if specified), and the deletion timestamp (NULL if still active).

See also: SHOW DROP DATABASES

SELECT * FROM system.databases_with_history;

┌────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ catalog │ name │ database_id │ owner │ dropped_on │
├─────────┼────────────────────┼─────────────────────┼──────────────────┼────────────────────────────┤
default │ system │ 4611686018427387905NULLNULL
default │ information_schema │ 4611686018427387906NULLNULL
defaultdefault1NULLNULL
default │ my_db │ 114NULL2024-11-15 02:44:46.207120
└────────────────────────────────────────────────────────────────────────────────────────────────────┘