I am trying to ensure that TCP_NODELAY is set (Nagle disabled) for Postgres client and server. I can see that there is code in libpq to use the option when a TCP_NODELAY macro is defined. I've cloned the postgres repo, run:
./configure
make CPOT='-DTCP_NODELAY'
and tried to link against the resulting static library. That results in undefined reference to symbol 'inet_net_ntop@@GLIBC_2.2.5'
adding -lresolv
fixes that and then there are a number of other undefined reference issues. I haven't been able to find any official documntation on postgres and TCP_NODELAY.
Does libpq and postgres server use TCP_NODELAY by default? Or not?
Am I on the right track above? It seems like there should be an easier way?
You are on the right track, but the correct way would be
./configure CPPFLAGS=-DTCP_NODELAY
make
make install
No, PostgreSQL does not use TCP_NODELAY
by default.