Re: [EXTERNAL] Support load balancing in libpq

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Daniel Gustafsson <daniel@yesql.se>, Jelte Fennema <postgres@jeltef.nl>, "Gregory Stark (as CFM)" <stark.cfm@gmail.com>, Andrey Borodin <amborodin86@gmail.com>, Jacob Champion <jchampion@timescale.com>, Maxim Orlov <orlovmg@gmail.com>, Jelte Fennema <Jelte.Fennema@microsoft.com>, Michael Banck <mbanck@gmx.net>, Andres Freund <andres@anarazel.de>
Date: 2023-03-27T13:35:50Z
Lists: pgsql-hackers
Hi,

> ```
> +        ret = store_conn_addrinfo(conn, addrlist);
> +        pg_freeaddrinfo_all(hint.ai_family, addrlist);
> +        if (ret)
> +            goto error_return;    /* message already logged */
> ```
> The goto path is not test-covered.

D'oh, this one is fine since store_conn_addrinfo() is going to fail
only when we are out of memory.

-- 
Best regards,
Aleksander Alekseev



Commits

  1. Fix pointer cast for seed calculation on 32-bit systems

  2. Copy and store addrinfo in libpq-owned private memory

  3. libpq: Use modern socket flags, if available.