check which port postgres is running code example Example: how to check port number for postgresql Click to copySELECT * FROM pg_settings WHERE name = 'port';