Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Robert Haas
On Fri, Aug 29, 2014 at 9:48 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-29 22:42:46 +0900, Michael Paquier wrote: Hi all, Using a plugin producing binary output, I came across this error: =# select data from pg_logical_slot_peek_changes('foo', NULL, NULL); ERROR: 0A000:

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Andres Freund
On 2014-09-03 09:36:32 -0400, Robert Haas wrote: On Fri, Aug 29, 2014 at 9:48 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-29 22:42:46 +0900, Michael Paquier wrote: Hi all, Using a plugin producing binary output, I came across this error: =# select data from

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Robert Haas
On Wed, Sep 3, 2014 at 10:45 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-09-03 09:36:32 -0400, Robert Haas wrote: On Fri, Aug 29, 2014 at 9:48 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-29 22:42:46 +0900, Michael Paquier wrote: Hi all, Using a plugin

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Andres Freund
On 2014-09-03 10:59:17 -0400, Robert Haas wrote: On Wed, Sep 3, 2014 at 10:45 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-09-03 09:36:32 -0400, Robert Haas wrote: On Fri, Aug 29, 2014 at 9:48 AM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-29 22:42:46 +0900,

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Robert Haas
On Wed, Sep 3, 2014 at 11:06 AM, Andres Freund and...@2ndquadrant.com wrote: Maybe: ERROR: pg_logical_slot_peek_changes cannot be used with a plugin that produces only binary output HINT: Use pg_logical_slot_peek_binary_changes instead. That level has no knowledge of what it's used

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-09-03 Thread Andres Freund
On 2014-09-03 11:23:21 -0400, Robert Haas wrote: On Wed, Sep 3, 2014 at 11:06 AM, Andres Freund and...@2ndquadrant.com wrote: Maybe: ERROR: pg_logical_slot_peek_changes cannot be used with a plugin that produces only binary output HINT: Use pg_logical_slot_peek_binary_changes

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-08-30 Thread Michael Paquier
On Fri, Aug 29, 2014 at 11:15 PM, Andres Freund and...@2ndquadrant.com wrote: On top of that, a logical receiver receives data in textual form even if the decoder is marked as binary when getting a message with PQgetCopyData. I have no idea what you mean by that. The data is sent in the

[HACKERS] Misleading error message in logical decoding for binary plugins

2014-08-29 Thread Michael Paquier
Hi all, Using a plugin producing binary output, I came across this error: =# select data from pg_logical_slot_peek_changes('foo', NULL, NULL); ERROR: 0A000: output plugin cannot produce binary output LOCATION: pg_logical_slot_get_changes_guts, logicalfuncs.c:404 Shouldn't the error message be

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-08-29 Thread Andres Freund
On 2014-08-29 22:42:46 +0900, Michael Paquier wrote: Hi all, Using a plugin producing binary output, I came across this error: =# select data from pg_logical_slot_peek_changes('foo', NULL, NULL); ERROR: 0A000: output plugin cannot produce binary output LOCATION:

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-08-29 Thread Michael Paquier
On Fri, Aug 29, 2014 at 10:48 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-29 22:42:46 +0900, Michael Paquier wrote: Hi all, Using a plugin producing binary output, I came across this error: =# select data from pg_logical_slot_peek_changes('foo', NULL, NULL); ERROR:

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-08-29 Thread Andres Freund
On 2014-08-29 23:07:44 +0900, Michael Paquier wrote: On Fri, Aug 29, 2014 at 10:48 PM, Andres Freund and...@2ndquadrant.com wrote: On 2014-08-29 22:42:46 +0900, Michael Paquier wrote: Hi all, Using a plugin producing binary output, I came across this error: =# select data from

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-08-29 Thread Michael Paquier
On Fri, Aug 29, 2014 at 11:15 PM, Andres Freund and...@2ndquadrant.com wrote: No, a textual output plugin is *NOT* allowed to produce binary output. That'd violate e.g. pg_logical_slot_peek_changes's return type because it's only declared to return text. A textual output plugin can call

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-08-29 Thread Andres Freund
On 2014-08-29 23:31:49 +0900, Michael Paquier wrote: On Fri, Aug 29, 2014 at 11:15 PM, Andres Freund and...@2ndquadrant.com wrote: No, a textual output plugin is *NOT* allowed to produce binary output. That'd violate e.g. pg_logical_slot_peek_changes's return type because it's only

Re: [HACKERS] Misleading error message in logical decoding for binary plugins

2014-08-29 Thread Michael Paquier
On Fri, Aug 29, 2014 at 11:39 PM, Andres Freund and...@2ndquadrant.com wrote: Yes. The output plugin declares whether it requires the *output method* to support binary data. pg_logical_slot_peek_changes *can not* support binary data because it outputs data as text.