anchor.diff:  with pkgs.lib;
   
   let
  +  makePostgresqlWalReceiverTest = subTestName: postgresqlPackage: let
  +
     postgresqlDataDir = "/var/db/postgresql/test";
     replicationUser = "wal_receiver_user";
     replicationSlot = "wal_receiver_slot";
     replicationConn = "postgresql://${replicationUser}@localhost";
     baseBackupDir = "/tmp/pg_basebackup";
     walBackupDir = "/tmp/pg_wal";
  -  recoveryConf = pkgs.writeText "recovery.conf" ''
  +  atLeast12 = versionAtLeast postgresqlPackage.version "12.0";
  +  restoreCommand = ''
       restore_command = 'cp ${walBackupDir}/%f %p'
     '';
   
  -  makePostgresqlWalReceiverTest = subTestName: postgresqlPackage: makeTest {
  +  recoveryFile = if atLeast12
  +      then pkgs.writeTextDir "recovery.signal" ""
  +      else pkgs.writeTextDir "recovery.conf" "${restoreCommand}";
  +
  +  in makeTest {
       name = "postgresql-wal-receiver-${subTestName}";
       meta.maintainers = with maintainers; [ pacien ];
   
  
positive.code:         slot = replicationSlot;
          directory = walBackupDir;
        };
      };
  
      testScript = ''
  
negative.code:           wal_level = archive # alias for replica on pg >= 9.6
            max_wal_senders = 10
            max_replication_slots = 10
          '' + optionalString atLeast12 ''
            ${restoreCommand}
            recovery_end_command = 'touch recovery.done'
          '';
          authentication = ''
            host replication ${replicationUser} all trust
  