Unverified Commit ebe3f332 authored by Hanefi Onaldi's avatar Hanefi Onaldi Committed by GitHub
Browse files

Add option to output numeric as string on wal2json (#576)

* Add option to output numeric as string on wal2json

This change adds a new option `--wal2json-numeric-as-string` that
changes wal2json plugin output format to print numeric data types as
strings. This is accomplished by passing the
`--numeric-data-types-as-string` option to wal2json plugin.

This is useful to prevent precision loss when using wal2json
plugin to stream changes from a database that uses numeric data types.

wal2json plugin version that supports `--numeric-data-types-as-string`
option is required to use this pgcopydb option. As of today there is no
official wal2json release that supports this option, but it is available
on master branch of the project.

Relevant changes in wal2json plugin is at
https://github.com/eulerto/wal2json/pull/255

* Add env to output numeric as string on wal2json

PGCOPYDB_WAL2JSON_NUMERIC_AS_STRING can be set to a boolean value that
will be used to determine if pgcopydb should set the wal2json option
`--numeric-data-types-as-string`.

In passing, also add the PGCOPYDB_OUTPUT_PLUGIN env variable to all
relevant pages of our documentation.
parent 2c140345
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment