redpanda-data / connect

Fancy stream processing made operationally mundane
https://docs.redpanda.com/redpanda-connect/about/
8.09k stars 817 forks source link

sql_insert postgres dsn #1312

Open h-4-t opened 2 years ago

h-4-t commented 2 years ago

Oh hai o/ An easy fix for an issue that I stumbled upon when playing with the sql_insert output :
Using the dsn suggested in the documentation (postgres://foouser:foopass@localhost:5432/foodb?sslmode=disable), benthos outputed the following network error in my docker-compose environment.

benthos_1     | {"@service":"benthos","label":"","level":"error","msg":"Failed to connect to sql_insert: default addr for network 'db:5432' unknown","path":"root.output","stream":"04-records2sql"}

A quick google research point out that the dsn should be wrapped with the network type as following:

postgres://foouser:foopass@tcp(localhost:5432)/foodb?sslmode=disable 

Hope that helps, and thanks again for this piece of gem that is benthos \o/

Jeffail commented 2 years ago

Hey @h-4-t, thanks for the update. We use the documented syntax in our integration tests so maybe something interesting going on here worth looking into. I'll mark this as a documentation issue for now.