471,083 Members | 1,214 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,083 software developers and data experts.

Connection log entries - random port number recorded

Hello,

I have postgres set to log all connections. I run it on port 5432. I
have noticed in the postgres logs that the port being used to connect to
the database is logged but never equal to 5432. The ip address recorded
is correct but the port number recorded is always a different number
each time.

This is 7.4.1-3 on cygwin. Has anyone noticed this on other platforms?

Mike

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #1
1 1674
mike g wrote:
Hello,

I have postgres set to log all connections. I run it on port 5432. I
have noticed in the postgres logs that the port being used to connect to
the database is logged but never equal to 5432. The ip address recorded
is correct but the port number recorded is always a different number
each time.


This is entirely normal. The database listens on port 5432, but the
client will connect *from* a randomly chosen port (it's not actually
random, but it is meaningless).

You can't have two connections with the same endpoints, i.e. if you open
up one connection and it goes:
client:12345 => server:5432
then the next outbound connection will have to use a different port e.g.
client:12346 => server:5432

On linux you can use "lsof -i" to see all current connections, I used to
use something similar on Windows, but can't remember what it was.

HTH
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Paul Robinson | last post: by
reply views Thread by JWM | last post: by
26 posts views Thread by Rajeev Tipnis | last post: by
17 posts views Thread by Danieltbt05 | last post: by
1 post views Thread by Laszlo Nagy | last post: by
7 posts views Thread by php_mysql_beginer911 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.