Raviprakash
Raviprakash

Reputation: 2440

Is there a way to list PostgreSQL servers?

Currently I am writing client to PostgreSQL servers. I want to list the details (ip address and port number) of the servers that is running PostgreSQL servers in the local network. Is there some methods in libpq or libpqxx ?

Regards
Devara Gudda

Upvotes: 2

Views: 1679

Answers (1)

Magnus Hagander
Magnus Hagander

Reputation: 25088

PostgreSQL has support for "bonjour", if your network supports it and PostgreSQL is built with it.

If you don't have that, then the answer is no. The closest you can get is to portscan the network on 5432 - but that still won't catch listeners on other ports.

Upvotes: 7

Related Questions