Add support for interface/ipaddress binding to libpq

From: Grigory Kareev <grigory(dot)kareev(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Add support for interface/ipaddress binding to libpq
Date: 2015-05-21 11:50:30
Message-ID: CAPi2LfC=ZVYr2jzrPVdTCw4fvr8Vfa0RPcjWDBdtmzFD2Y+TyQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello!

I'm willing to implement the 'Add support for interface/ipaddress binding
to libpq' feature from the ToDo list.
Actually, the 'ipaddress' part.

For this I'm planning to do the following:
- Introduce 'sourceaddr' parameter keyword and 'PGSOURCEADDR' env var
which can be used to specify local IPv4 or IPv6 ipaddress to bind to
- Silently ignore the parameter's value in case of Unix-domain
communication with database
- Use BLOCKING bind() call to bind communication socket to specified
local ipaddress in two functions:
src/interfaces/libpq/fe-connect(dot)c(at)internal_cancel()
src/interfaces/libpq/fe-connect(dot)c(at)PQconnectPoll()

Is this enough or I missed something?

WBR, Grigory.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-05-21 12:12:20 Re: Change pg_cancel_*() to ignore current backend
Previous Message Robert Haas 2015-05-21 11:41:37 Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.