anchor.diff:  
   bind(C, Statement, PortalName, Parameters) ->
       Ref = pgsql_sock:bind(C, Statement, PortalName, Parameters),
  -    case receive_atom(C, Ref, ok, ok) of
  -        ok ->
  -            ok;
  -        Error ->
  -            Ref2 = pgsql_sock:sync(C),
  -            receive_atom(C, Ref2, done, ok),
  -            Error
  -    end.
  +    sync_on_error(C, receive_atom(C, Ref, ok, ok)).
   
   %% execute
   
  
positive.code: 
  parse(C, Name, Sql, Types) ->
      Ref = pgsql_sock:parse(C, Name, Sql, Types),
      case receive_describe(C, Ref, #statement{name = Name}) of
          Res = {ok, _} ->
              Res;
          Error ->
              Ref2 = pgsql_sock:sync(C),
              receive_atom(C, Ref2, done, ok),
              Error
      end.
  
  %% bind
  
  
negative.code:         {'EXIT', C, _Reason} ->
              {error, closed}
      end.
  
  sync_on_error(C, Error = {error, _}) ->
      Ref = pgsql_sock:sync(C),
      receive_atom(C, Ref, done, ok),
      Error;
  
  sync_on_error(_C, R) ->
      R.
  
  