anchor.diff:      {ok, Data} = Mod:recv(Sock, 0, Timeout),
       State#state{tail = <<Tail/binary, Data/binary>>}.
   
  -auth(User, Password, State) ->
  -    State2 = #state{tail = Tail} = recv(State),
  -    case pgsql_wire:decode_message(Tail) of
  -        {Message, Tail2} ->
  -            State3 = State2#state{tail = Tail2},
  -            case Message of ->
  -                    %% AuthenticationOk
  -                    {$R, <<0:?int32>>} ->
  -                                    State3
  -            end
  -        _ -> auth(User, Password, State2)
  -    end.
  +%% AuthenticationOk
  +auth(User, Password, {$R, <<0:?int32>>}, State) ->
  +    State#state{on_message = fun on_message/2}.
   
   on_message({$N, Data}, State) ->
       %% TODO use it
  
positive.code:     end,
      send([<<196608:?int32>>, Opts3, 0], State2),
  %% TODO    Async   = proplists:get_value(async, Opts, undefined),
  %% TODO    setopts(State2, [{active, true}]),
      {ok, initialize(auth(User, Password, State2))}.
  
  handle_call(Call, _From, State) ->
      {stop, {unsupported_call, Call}, State}.
  
negative.code: -include("pgsql.hrl").
  -include("pgsql_binary.hrl").
  
  -record(state, {mod, sock, tail, backend, on_message}).
  
  %% -- client interface --
  
  