Copy and store addrinfo in libpq-owned private memory
Daniel Gustafsson <dgustafsson@postgresql.org>
Copy and store addrinfo in libpq-owned private memory This refactors libpq to copy addrinfos returned by getaddrinfo to memory owned by libpq such that future improvements can alter for example the order of entries. As a nice side effect of this refactor the mechanism for iteration over addresses in PQconnectPoll is now identical to its iteration over hosts. Author: Jelte Fennema <postgres@jeltef.nl> Reviewed-by: Aleksander Alekseev <aleksander@timescale.com> Reviewed-by: Michael Banck <mbanck@gmx.net> Reviewed-by: Andrey Borodin <amborodin86@gmail.com> Discussion: https://postgr.es/m/PR3PR83MB04768E2FF04818EEB2179949F7A69@PR3PR83MB0476.EURPRD83.prod.outlook.com
Files
| Path | Change | +/− |
|---|---|---|
| src/include/libpq/pqcomm.h | modified | +6 −0 |
| src/interfaces/libpq/fe-connect.c | modified | +81 −31 |
| src/interfaces/libpq/libpq-int.h | modified | +4 −3 |
| src/tools/pgindent/typedefs.list | modified | +1 −0 |
Discussion
- Support load balancing in libpq 52 messages · 2022-06-10 → 2023-03-30