Re: Changing the state of data checksums in a running cluster - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Changing the state of data checksums in a running cluster
Date
Msg-id 46d52594-fa93-4fbe-ad97-dc3127a04dd8@iki.fi
Whole thread Raw
In response to Re: Changing the state of data checksums in a running cluster  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: Changing the state of data checksums in a running cluster
List pgsql-hackers
On 18/03/2026 00:01, Daniel Gustafsson wrote:
>> On 17 Mar 2026, at 12:45, Heikki Linnakangas <hlinnaka@iki.fi> 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




pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Skipping schema changes in publication
Next
From: Peter Eisentraut
Date:
Subject: Re: Supporting non-deterministic collations with tailoring rules.