On 18/03/2026 00:01, Daniel Gustafsson wrote:
On 17 Mar 2026, at 12:45, Heikki Linnakangas <[email protected]> wrote:>>> /*
* Get a list of all databases to process. This may include databases that
* were created during our runtime. Since a database can be created as a
* copy of any other database (which may not have existed in our last
* run), we have to repeat this loop until no new databases show up in the
* list. Here the initial list for the loop processing is generated after
* waiting for all existing transactions to finish to ensure that we can
* see any database which was created even if the transaction in which it
* was created started before checksums were being processed.
*/
WaitForAllTransactionsToFinish();
DatabaseList = BuildDatabaseList();
What if a database is dropped and another one is created with the same database
OID?
Good point. We have the name of the database so we could compare Oid and name,
and require both to match. That would still be foiled by a new database using
the same Oid and name though. Any ideas on what could be done?
Well, if CREATE DATABASE computed the checksums, that would fix this
too. Actually, at least in the default wal_log=true mode, doesn't it
already do that? It goes through the buffer cache as usual, I presume
the checksums will be computed too.
- Heikki