It seems test_decoding.c could be easily changed to support JSON by using the built in PostgreSQL functions (json.c composite_to_json) to convert a Datum into SQL. It's use of OidOutputFunctionCall could be modified to emit arrays and composite types as JSON. This might be enough to enable downstream frameworks to parse (without having to code to the terse and positional composite structure format).
It could be a minimal change to have in core using the built in JSON support with no additional libraries. I have not made changes to this code but it seems like it should work.
Thank you,
Henry
On Tue, Sep 26, 2017 at 9:37 AM Alvaro Hernandez <
aht@ongres.com> wrote:
On 26/09/17 17:50, Craig Ringer wrote:
Yeah, I know the policy. But asking is free ;) and in my opinion this would be a very good reason to have an exception, if there would be a clear desire to have a single, unified, production quality output plugin across all PostgreSQL versions. At least I tried ;)
Given all this, if I would be doing an app based on logical decoding, I think I will stick to test_decoding for <10....
Thanks,
Álvaro
--
Alvaro Hernandez
-----------
OnGres