Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres writer always defaults to 5423 no matter what Port value you specify in the DB connection string. #174

Open
0101binary0101 opened this issue Aug 31, 2023 · 0 comments

Comments

@0101binary0101
Copy link

When using the Postgres Writer to connect and write data to a different Postgres port the DB Connection String Port= is being over written by the default value of 5432, and therefore I was seeing 'Connection refused' messages.

e.g. User ID=postgres;Password=*****;Host=mypostgresbox;Port=5434;Database=logshark;Pooling=true;

I found a workaround to select a different port looking at the code of this bit, where it extracts the port from the db hostname.

var r = Regex.Match(host, @"(?<host>.*?)(:?(?<port>\d+))?$");

I modified my connection string as follows:
e.g. User ID=postgres;Password=*****;Host=mypostgresbox:5434;Port=5434;Database=logshark;Pooling=true;

After this the Postgres Writer was able to write data to my postgres instance listening on a different port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant