Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.74 KB

postgres.md

File metadata and controls

45 lines (31 loc) · 1.74 KB

PostgreSQL

The PostgreSQL adaptor is capable of reading and tailing databases.

Example

src_type=postgres
src_uri=postgres://127.0.0.1:5432/test
tail=false

dest_type=elasticsearch
dest_uri=https://USERID:PASS@scalr.api.appbase.io/APPNAME

For the destination URI, instead of using your user-id and password, you could also use your admin API key.

https://admin-API-key@scalr.api.appbase.io/APPNAME

You can find your admin API key inside your app page at appbase.io under Security -> API Credentials.

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 for this to work. (See ALTER role)
  2. When tailing, you might have to create replication slots. Also set wal_level.
wal_level=logical
max_replication_slots=1
  1. Create a logical replication slot for the source database. (Logical)
select * from pg_create_logical_replication_slot('standby_replication_slot', 'test_decoding');
SELECT * FROM pg_replication_slots ;
  1. Make sure you see the database name in replication slot row. Now update replication_slot parameter of pipeline.js to 'standby_replication_slot'