Last active
October 2, 2025 18:45
-
-
Save tetri/dd91241452b96bffa4c671e66158c7a5 to your computer and use it in GitHub Desktop.
Consulta de todas as bases de dados no servidor PostgreSQL conectado ordenado por data estimada de criação (mais recentes primeiro).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT D.DATNAME AS DATABASE_NAME, | |
| PG_SIZE_PRETTY(PG_DATABASE_SIZE(D.DATNAME)) AS SIZE, | |
| PG_CATALOG.SHOBJ_DESCRIPTION(D.OID, 'PG_DATABASE') AS DESC, | |
| (PG_STAT_FILE('base/' || D.OID || '/PG_VERSION')).MODIFICATION AS ESTIMATED_CREATION_DATE | |
| FROM PG_CATALOG.PG_DATABASE D | |
| WHERE D.DATISTEMPLATE = FALSE | |
| ORDER BY ESTIMATED_CREATION_DATE DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment