Re: Proposal: Generic WAL logical messages - Mailing list pgsql-hackers

From Petr Jelinek
Subject Re: Proposal: Generic WAL logical messages
Date
Msg-id 56F2D7F3.20605@2ndquadrant.com
Whole thread Raw
In response to Re: Proposal: Generic WAL logical messages  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: Proposal: Generic WAL logical messages  (Petr Jelinek <petr@2ndquadrant.com>)
List pgsql-hackers
On 23/03/16 14:17, Alvaro Herrera wrote:
> Petr Jelinek wrote:
>
>> +++ b/contrib/test_decoding/sql/messages.sql
>> @@ -0,0 +1,17 @@
>> +-- predictability
>> +SET synchronous_commit = on;
>> +
>> +SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
>> +
>> +SELECT 'msg1' FROM pg_logical_emit_message(true, 'test', 'msg1');
>> +SELECT 'msg2' FROM pg_logical_emit_message(false, 'test', 'msg2');
>> +
>> +BEGIN;
>> +SELECT 'msg3' FROM pg_logical_emit_message(true, 'test', 'msg3');
>> +SELECT 'msg4' FROM pg_logical_emit_message(false, 'test', 'msg4');
>> +SELECT 'msg5' FROM pg_logical_emit_message(true, 'test', 'msg5');
>> +COMMIT;
>> +
>> +SELECT data FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL, 'force-binary', '0',
'skip-empty-xacts','1'); 
>> +
>> +SELECT 'init' FROM pg_drop_replication_slot('regression_slot');
>
> No tests for a rolled back transaction?
>

Good point, probably worth testing especially since we have
non-transactional messages.

--
   Petr Jelinek                  http://www.2ndQuadrant.com/
   PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Vladimir Sitnikov
Date:
Subject: Re: NOT EXIST for PREPARE
Next
From: Merlin Moncure
Date:
Subject: Re: NOT EXIST for PREPARE