BDR Custom Conflict Handler

Поиск
Список
Период
Сортировка
От Elijah Bitting
Тема BDR Custom Conflict Handler
Дата
Msg-id loom.20160607T203102-862@post.gmane.org
обсуждение исходный текст
Список pgsql-general
There appears to be absolutely zero documentation regarding the expected
format of a custom conflict handler function.

I'm attempting to define a custom conflict handler for a test bdr
cluster. When I tried to register a generic function with no parameters
I get a somewhat useful error message which states that the function is
expected to have a signature like this:

select * from bdr.bdr_create_conflict_handler('test',
'customconflictmgr',
'test_conflict_trigger()', 'update_update');

ERROR: conflict handler function signature must be (IN tablerow, IN
tablerow, IN text, IN regclass, IN bdr.bdr_conflict_type, OUT tablerow,
OUT bdr.bdr_conflict_handler_action)
SQL state: XX000
Hint: OUT argument are not of the expected types.

So I then attempted to define a function with specified signature:

select * from bdr.bdr_replicate_ddl_command('
CREATE OR REPLACE FUNCTION public.test_conflict_trigger(IN r1 tablerow,
IN r2 tablerow, IN t1 text, IN rc1 regclass, IN c1
bdr.bdr_conflict_type, OUT rout tablerow, OUT a1
bdr.bdr_conflict_handler_action)
  RETURNS record AS
$BODY$
BEGIN
    raise notice ''conflict detected in test table'';
END;
$BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;
ALTER FUNCTION public.test_conflict_trigger(IN r1 oid, IN r2 oid, IN t1
text, IN rc1 regclass, IN c1 bdr.bdr_conflict_type, OUT rout text, OUT
a1 bdr.bdr_conflict_handler_action)
  OWNER TO postgres;
');


and get this error:
ERROR:  type tablerow does not exist

What is tablerow type???????? Does there exist anywhere an example of a
custom conflict handler function???


В списке pgsql-general по дате отправления:

Предыдущее
От: Patrick B
Дата:
Сообщение: Re: Re-sync slave server
Следующее
От: Patrick B
Дата:
Сообщение: Re: Re-sync slave server