anchor.diff:  -include("pgsql.hrl").
   -include("pgsql_binary.hrl").
   
  --record(state, {mod, sock, tail, backend}).
  +-record(state, {mod, sock, tail, backend, on_message}).
   
   %% -- client interface --
   
  
positive.code: handle_info({_, _Sock, Data}, #state{tail = Tail} = State) ->
      on_tail(State#state{tail = <<Tail/binary, Data/binary>>}.
  
  on_tail(#state{tail = Tail} = State) ->
      case pgsql_wire:decode_message(Tail) of
          {Message, Tail2} ->
              on_tail(on_message(Message, State#{tail = Tail2}));
          _ ->
              {noreply, State}
      end.
  
negative.code:     {ok, Data} = Mod:recv(Sock, 0, Timeout),
      State#state{tail = <<Tail/binary, Data/binary>>}.
  
  %% AuthenticationOk
  auth(User, Password, {$R, <<0:?int32>>}, State) ->
      State#state{on_message = fun on_message/2}.
  
  on_message({$N, Data}, State) ->
      %% TODO use it
  