test=> SELECT setting FROM pg_settings WHERE name = 'port';SHOW PORT;
setting
---------
5432
Both of these are from a query context. This is in a C module, I suppose I could run a query but there has to be a direct C function to get this data.
test=> SELECT setting FROM pg_settings WHERE name = 'port';SHOW PORT;