Re: pgsql: Generic Messages for Logical Decoding

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Generic Messages for Logical Decoding
Date: 2016-04-06 12:55:46
Message-ID: CAB7nPqROd2MXqy_5+cZJVhW0wHrrz6P8jV_RSbLcrXRTwLh7tQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Wed, Apr 6, 2016 at 6:08 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> Generic Messages for Logical Decoding
>
> API and mechanism to allow generic messages to be inserted into WAL that are
> intended to be read by logical decoding plugins. This commit adds an optional
> new callback to the logical decoding API.
>
> Messages are either text or bytea. Messages can be transactional, or not, and
> are identified by a prefix to allow multiple concurrent decoding plugins.
>
> (Not to be confused with Generic WAL records, which are intended to allow crash
> recovery of extensible objects.)

jacana says boom:
http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=jacana&dt=2016-04-06%2012%3A02%3A05

*** c:/mingw/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.build/../pgsql/contrib/test_decoding/expected/messages.out
Wed Apr 6 08:02:30 2016
--- c:/mingw/msys/1.0/home/pgrunner/bf/root/HEAD/pgsql.build/contrib/test_decoding/./regression_output/results/messages.out
Wed Apr 6 08:40:24 2016
***************
*** 54,75 ****

COMMIT;
SELECT 'žluťoučký kůň' FROM pg_logical_emit_message(true, 'test',
'žluťoučký kůň');
! ?column?
! ---------------
! žluťoučký kůň
! (1 row)
!
SELECT data FROM pg_logical_slot_get_changes('regression_slot',
NULL, NULL, 'force-binary', '0', 'skip-empty-xacts', '1');
data
! ----------------------------------------------------------------------
message: transactional: 1 prefix: test, sz: 4 content:msg1
message: transactional: 0 prefix: test, sz: 4 content:msg2
message: transactional: 0 prefix: test, sz: 4 content:msg4
message: transactional: 0 prefix: test, sz: 4 content:msg6
message: transactional: 1 prefix: test, sz: 4 content:msg5
message: transactional: 1 prefix: test, sz: 4 content:msg7
! message: transactional: 1 prefix: test, sz: 19 content:žluťoučký kůň
! (7 rows)

SELECT 'init' FROM pg_drop_replication_slot('regression_slot');
?column?
--- 54,70 ----

COMMIT;
SELECT 'žluťoučký kůň' FROM pg_logical_emit_message(true, 'test',
'žluťoučký kůň');
! ERROR: character with byte sequence 0xc5 0xa5 in encoding "UTF8"
has no equivalent in encoding "WIN1252"
SELECT data FROM pg_logical_slot_get_changes('regression_slot',
NULL, NULL, 'force-binary', '0', 'skip-empty-xacts', '1');
data
! ------------------------------------------------------------
message: transactional: 1 prefix: test, sz: 4 content:msg1
message: transactional: 0 prefix: test, sz: 4 content:msg2
message: transactional: 0 prefix: test, sz: 4 content:msg4
message: transactional: 0 prefix: test, sz: 4 content:msg6
message: transactional: 1 prefix: test, sz: 4 content:msg5
message: transactional: 1 prefix: test, sz: 4 content:msg7
! (6 rows)

SELECT 'init' FROM pg_drop_replication_slot('regression_slot');
?column?

I thought we always avoided non-ASCII characters in tests, no?
--
Michael

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2016-04-06 13:00:20 Re: [COMMITTERS] pgsql: Avoid archiving XLOG_RUNNING_XACTS on idle server
Previous Message Simon Riggs 2016-04-06 12:50:24 Re: [COMMITTERS] pgsql: Avoid archiving XLOG_RUNNING_XACTS on idle server