yandex / odyssey

Scalable PostgreSQL connection pooler
BSD 3-Clause "New" or "Revised" License
3.21k stars 161 forks source link

show servers/clients return text in int column #282

Open mdevan opened 3 years ago

mdevan commented 3 years ago

The columns port and local_port are declared as integers in the console commands "show servers" and "show clients". See:

https://github.com/yandex/odyssey/blob/master/sources/console.c#L1040

https://github.com/yandex/odyssey/blob/master/sources/console.c#L1192

but they can return a string sometimes: <unix socket>

This confuses the database driver (at least Golang lib/pq) which tries to parse it as an integer.

The port should be a valid number, even for unix sockets, as it is relevant for Postgres.

x4m commented 3 years ago

Thanks for reporting this! Probably, we need a fallback for unix socket here https://github.com/yandex/odyssey/blob/master/sources/console.c#L966