anchor.diff:  -define(PRIMARY_KEEPALIVE_MESSAGE, $k).
   -define(STANDBY_STATUS_UPDATE, $r).
   
  +-record(repl,
  +        {
  +          last_received_lsn :: integer() | undefined,
  +          last_flushed_lsn :: integer() | undefined,
  +          last_applied_lsn :: integer() | undefined,
  +          feedback_required :: boolean() | undefined,
  +          cbmodule :: module() | undefined,
  +          cbstate :: any() | undefined,
  +          receiver :: pid() | undefined
  +        }).
  +
   -record(state, {mod,
                   sock,
                   data = <<>>,
  
positive.code:     {reply, {ok, Status}, State};
  
  handle_call({standby_status_update, FlushedLSN, AppliedLSN}, _From,
      #state{repl_last_received_lsn = ReceivedLSN} = State) ->
      send(State, ?COPY_DATA, epgsql_wire:encode_standby_status_update(ReceivedLSN, FlushedLSN, AppliedLSN)),
      {reply, ok, State#state{repl_last_flushed_lsn = FlushedLSN, repl_last_applied_lsn = AppliedLSN}};
  
  handle_call(Command, From, State) ->
      #state{queue = Q} = State,
  
negative.code: -export([init/1, code_change/3, terminate/2]).
  
  %% state callbacks
  -export([auth/2, initializing/2, on_message/2, on_replication/2]).
  
  -include("epgsql.hrl").
  -include("epgsql_binary.hrl").
  