anchor.diff:          <<"28P01">> -> Why = invalid_password;
           Any         -> Why = Any
       end,
  -    notify(State, {error, Why}),
  -    {stop, normal, State};
  +    {stop, normal, reply(State, {error, Why})};
   
   auth(Other, State) ->
       on_message(Other, State).
   
   %% BackendKeyData
   initializing({$K, <<Pid:?int32, Key:?int32>>}, State) ->
  -    State2 = State#state{backend = {Pid, Key}},
  -    {noreply, State2};
  +    {noreply, State#state{backend = {Pid, Key}}};
   
   %% ReadyForQuery
   initializing({$Z, <<Status:8>>}, State) ->
  -    #state{parameters = Parameters, queue = Q} = State,
  +    #state{parameters = Parameters} = State,
       erase(username),
       erase(password),
       %% TODO decode dates to now() format
  
positive.code: sync_required(#state{queue = Q} = State) ->
      case queue:is_empty(Q) of
          false ->
              case request_tag(State) of
                  T when T == sync ->
                      State;
                  _ ->
                      notify(State, {error, sync_required}),
                      sync_required(State#state{queue = queue:drop(Q)})
              end;
          true ->
              State#state{sync_required = true}
  
negative.code:     #state{queue = Q} = State,
      Types = [pgsql_types:oid2type(Oid) || <<Oid:?int32>> <= Bin],
      Name = case queue:get(Q) of
                 {_, {parse, N, _, _}} -> N;
                 {_, {describe_statement, N}} -> N
             end,
      {noreply, State#state{statement = #statement{name = Name,
                                                   types = Types}}};
  
  %% RowDescription
  on_message({$T, <<Count:?int16, Bin/binary>>}, State) ->
      Columns = pgsql_wire:decode_columns(Count, Bin),
      State2 = case command_tag(State) of
                   C when C == squery ->
                       State#state{columns = Columns};
                   C when C == parse; C == describe_statement ->
                       reply(State,
                             {ok, State#state.statement#statement{
                                                columns = Columns}});
                   C when C == describe_portal ->
                       reply(State, {ok, Columns})
               end,
      {noreply, State2};
  
  %% NoData
  on_message({$n, <<>>}, State) ->
      State2 = case command_tag(State) of
                   C when C == parse; C == describe_statement ->
                       reply(State,
                             {ok, State#state.statement#statement{columns= []}});
                   describe_portal ->
                       reply(State, {ok, []})
               end,
      {noreply, State2};
  
  %% BindComplete
  on_message({$2, <<>>}, State) ->
      State2 = case command_tag(State) of
                   equery ->
                       State;
                   bind ->
                       reply(State, ok)
               end,
      {noreply, State2};
  
  %% CloseComplete
  on_message({$3, <<>>}, State) ->
      State2 = case command_tag(State) of
                   close ->
                       reply(State, ok);
                   equery ->
                       State
               end,
      {noreply, State2};
  