The [PostgreSQL](https://www.postgresql.org/) adaptor is capable of reading and tailing databases.
### Example
```ini
src.type=postgres
src.uri=postgres://127.0.0.1:5432/test
tail=true
dest.type=elasticsearch
dest.uri=https://USER:PASSWORD@SERVER/INDEX
```
### Notes
1. When using postgres as source, append `?sslmode=disable` to the uri to disable ssl otherwise you will have to put a certificate.
#### Tailing
1. When using `tail: true` with postgres, you might get the error `must be superuser or replication role to use replication slots`. You need a [REPLICATION role](https://www.postgresql.org/docs/9.1/static/sql-createrole.html) for this to work. (See [ALTER role](https://www.postgresql.org/docs/9.0/static/sql-alterrole.html))
2. When tailing, you might have to [create replication slots](https://medium.com/@tk512/replication-slots-in-postgresql-b4b03d277c75). Also set `wal_level`.
```ini
wal_level=logical
max_replication_slots=1
```
3. Create a logical replication slot for the source database. ([Logical](https://www.postgresql.org/docs/9.5/static/logicaldecoding-example.html))