anchor.diff:          statement -> ?PREPARED_STATEMENT;
           portal    -> ?PORTAL
       end,
  -    send(State, ?CLOSE, [Type2, Name, 0]),
  -    send(State, ?FLUSH, []),
  +    send_multi(State, [
  +        {?CLOSE, [Type2, Name, 0]},
  +        {?FLUSH, []}
  +    ]),
       {noreply, State};
   
   command(sync, State) ->
  
positive.code: 
  send(#state{mod = Mod, sock = Sock}, Type, Data) ->
      do_send(Mod, Sock, epgsql_wire:encode(Type, Data)).
  
  do_send(gen_tcp, Sock, Bin) ->
      try erlang:port_command(Sock, Bin) of
  
negative.code:     Typed_Parameters = lists:zip(Types, Parameters),
      Bin1 = epgsql_wire:encode_parameters(Typed_Parameters, Codec),
      Bin2 = epgsql_wire:encode_formats(Columns),
      send_multi(State, [
          {?BIND, [PortalName, 0, StatementName, 0, Bin1, Bin2]},
          {?FLUSH, []}
      ]),
      {noreply, State};
  
  command({execute, _Statement, PortalName, MaxRows}, State) ->
      send_multi(State, [
          {?EXECUTE, [PortalName, 0, <<MaxRows:?int32>>]},
          {?FLUSH, []}
      ]),
      {noreply, State};
  
  command({execute_batch, Batch}, #state{codec = Codec} = State) ->
      Commands =
          lists:foldr(
            fun({Statement, Parameters}, Acc) ->
                    #statement{name = StatementName,
                               columns = Columns,
                               types = Types} = Statement,
                    Typed_Parameters = lists:zip(Types, Parameters),
                    Bin1 = epgsql_wire:encode_parameters(Typed_Parameters, Codec),
                    Bin2 = epgsql_wire:encode_formats(Columns),
                    [{?BIND, [0, StatementName, 0, Bin1, Bin2]},
                     {?EXECUTE, [0, <<0:?int32>>]} | Acc]
            end,
            [{?SYNC, []}],
            Batch),
      send_multi(State, Commands),
      {noreply, State};
  
  command({describe_statement, Name}, State) ->
      send_multi(State, [
          {?DESCRIBE, [?PREPARED_STATEMENT, Name, 0]},
          {?FLUSH, []}
      ]),
      {noreply, State};
  
  command({describe_portal, Name}, State) ->
      send_multi(State, [
          {?DESCRIBE, [?PORTAL, Name, 0]},
          {?FLUSH, []}
      ]),
      {noreply, State};
  
  command({close, Type, Name}, State) ->
  