anchor.diff:  [[setting-up-PostgreSQL]]
   == Setting up PostgreSQL
   
  -Before using the Debezium PostgreSQL connector to monitor the changes committed on a PostgreSQL server, first install the logical decoding plugin into the PostgreSQL server, enable a replication slot, and configure a user with sufficient privileges to perform the replication.
  -
  -Note that *if your database is hosted by a service* such as https://www.heroku.com/postgres[Heroku Postgres] you may be unable to install the plugin. If so, you'll be unable to monitor your database with Debezium.
  +Before using the Debezium PostgreSQL connector to monitor the changes committed on a PostgreSQL server, first decide which logical decoder method you intend to use.  If you plan not to use the native PgOutput logical replication stream support, then you will need to install the logical decoding plugin into the PostgreSQL server.  Afterward enable a replication slot, and configure a user with sufficient privileges to perform the replication.
  +
  +Note that *if your database is hosted by a service* such as https://www.heroku.com/postgres[Heroku Postgres] you may be unable to install the plugin. If so, if you're using PostgreSQL 10+ then you'll need to use the PgOutput decoder support to monitor your database.  If that isn't an option, you'll be unable to monitor your database with Debezium.
   
   [[amazon-rds]]
   === PostgreSQL on Amazon RDS
  
positive.code: Also see link:/docs/install/postgres-plugins/[Logical Decoding Output Plug-in Installation for PostgreSQL] for more detailed instructions of setting up and testing logical decoding plug-ins.
  ====
  
  As of PostgreSQL 9.4, the only way to read changes to the write-ahead-log is to first install a logical decoding output plugin. Plugins are written in C, compiled, and installed on the machine which runs the PostgreSQL server. Plugins use  a number of PostgreSQL specific APIs, as described by the https://www.postgresql.org/docs/9.6/static/logicaldecoding-output-plugin.html[_PostgreSQL documentation_].
  
  Debezium's PostgreSQL connector works with one of Debezium's supported logical decoding plugin to encode the changes in either https://github.com/google/protobuf[_Protobuf format_] or http://www.json.org/[_JSON_] format.
  
negative.code: * a logical decoding output plugin which has to be installed and configured in the PostgreSQL server, one of
  ** https://github.com/debezium/postgres-decoderbufs[Protobuf based]
  ** https://github.com/eulerto/wal2json[wal2json]
  
  [NOTE]
  ====
  As of Debezium 0.10, we introduced support for PostgreSQL 10+ Pgoutput logical replication.  This decoder mode does not require the installation of any additional libraries as the connector is able to interpret the raw replication event stream into change events directly.
  ====
  * Java code which reads the changes produced by the plugin in Protobuf format, using PostgreSQL's https://www.postgresql.org/docs/9.6/static/logicaldecoding-walsender.html[_streaming replication protocol_], via the PostgreSQL https://github.com/pgjdbc/pgjdbc[_JDBC driver_]
  
  The connector then produces a _change event_ for every row-level insert, update, and delete operation that was received, recording all the change events for each table in a separate Kafka topic. Your client applications read the Kafka topics that correspond to the database tables they're interested in following, and react to every row-level event it sees in those topics.
  