anchor.diff:  
     ###### implementation
   
  -  config = mkIf config.services.postgresql.enable {
  +  config = mkIf cfg.enable {
   
       assertions = [
  -      { assertion = cfg.groupAccess -> builtins.compareVersions cfg.package.version "11.0" >= 0;
  +      { assertion = cfg.groupAccess -> versionAtLeast cfg.package.version "11.0";
           message = ''
             'groupAccess' is not available for PostgreSQL < 11.
           '';
  
positive.code:         default = "";
          description = ''
            Defines the mapping from system users to database users.
          '';
        };
  
  
negative.code:             else pkgs.postgresql_9_4);
  
      services.postgresql.dataDir =
        mkDefault (if versionAtLeast config.system.stateVersion "17.09"
                    then "/var/lib/postgresql/${cfg.package.psqlSchema}"
                    else "/var/db/postgresql");
  
      services.postgresql.initdbFlags =
        mkDefault (lib.optional cfg.groupAccess "--allow-group-access");
  
      services.postgresql.authentication = mkAfter
        ''
  