anchor.diff:           validate/1,
            validate_binding/2]).
   
  +-include("pgsql_listen.hrl").
  +
   -rabbit_boot_step({?MODULE,
  -  [{description, ?X_DESC},
  -   {mfa,         {rabbit_registry, register, [exchange, ?X_TYPE, ?MODULE]}},
  -   {requires,    rabbit_registry},
  -   {enables,     recovery}]}).
  +                  [{description, ?X_DESC},
  +                   {mfa,         {rabbit_registry, register,
  +                                  [exchange, ?X_TYPE, ?MODULE]}},
  +                   {requires,    rabbit_registry},
  +                   {enables,     recovery}]}).
   
  -% ------------------------------------
  -% Exchange Methods exposed to RabbitMQ
  -% ------------------------------------
  +-include_lib("rabbit_common/include/rabbit.hrl").
   
   add_binding(none, X, B) ->
     gen_server:cast(pgsql_listen, {add_binding, X, B}),
  
positive.code: delete(_, _, _) ->
    ok.
  
  policy_changed(OldX = #exchange{name = Name}, NewX) ->
    Bs = rabbit_binding:list_for_source(OldX),
    case gen_server:call(pgsql_listen, {delete, OldX, Bs}) of
      ok ->
  
negative.code:   case gen_server:call(pgsql_listen, {validate, X}) of
      ok -> ok;
      {error, Reason} ->
        rabbit_log:error("postgresql connection validation failed: ~s", [Reason]),
        rabbit_misc:protocol_error(resource_error,
                                   "postgresql connection validation failed: ~s",
                                   [Reason])
    end.
  
  