From: | "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com> |
---|---|
To: | 'Phil Godfrin' <pgodfrin(at)comcast(dot)net> |
Cc: | "philippe(dot)godfrin(at)nov(dot)com" <philippe(dot)godfrin(at)nov(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | RE: FDW and connections |
Date: | 2021-05-17 00:43:07 |
Message-ID: | TYAPR01MB2990209A5B86B1E97DE96D66FE2D9@TYAPR01MB2990.jpnprd01.prod.outlook.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
From: Phil Godfrin <pgodfrin(at)comcast(dot)net>
My question is - how does the call to GetConnection() know what port to use? Lets say we're using PGBouncer to connect on the local server at port 6432, but there is no pgbouncer listening at the foreign server, what port gets passed? My first thought is whatever the client connects port is, but I believe pgbouncer ultimately hands of the connection to whatever port you have defined for the local database...
This gets important when one has an HAProxy instance between the local and foreign servers which is interrogating the port number to decide which ip:port to send the request to, ultimately the master or replicant at the foreign remoter server.
So how does the port number get propagated from local to foreign server???
--------------------------------------------------
postgres_fdw uses libpq as a client to connect to the foreign server. So, as the following says, you can specify the libpq's "port" parameter in CREATE SERVER. If it's ommitted as in your case, the default 5432 will be used.
F.35.1.1. Connection Options
https://www.postgresql.org/docs/devel/postgres-fdw.html
"A foreign server using the postgres_fdw foreign data wrapper can have the same options that libpq accepts in connection strings, as described in Section 34.1.2, except that these options are not allowed or have special handling:"
I'm afraid it's better to post user-level questions like this to pgsql-general(at)lists(dot)postgresql(dot)org(dot)
Regards
Takayuki Tsunakawa
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2021-05-17 01:12:26 | pg_dumpall misses --no-toast-compression |
Previous Message | Tatsuo Ishii | 2021-05-17 00:33:27 | Re: Typo in README.barrier |