Thread: PostgreSQL network discovery

PostgreSQL network discovery

From
"Gevik Babakhani"
Date:
Hi,

There is a nice little feature within MSSQL where it is possible to
enumerate all MSSQL servers on the local network. 
I wonder how this can be made possible with PG. Pinging every IP:PGPORT
within the current subnet is one of the options but I guess that would be
just a bad solution.  Any thoughts?

Regards,
Gevik
http://www.truesoftware.net/gevik/



Re: PostgreSQL network discovery

From
Magnus Hagander
Date:
Gevik Babakhani wrote:
> Hi,
> 
> There is a nice little feature within MSSQL where it is possible to
> enumerate all MSSQL servers on the local network. 
> I wonder how this can be made possible with PG. Pinging every IP:PGPORT
> within the current subnet is one of the options but I guess that would be
> just a bad solution.  Any thoughts?

Isn't the bonjour support supposed to do this?
(Never used it myself though)

//Magnus


Re: PostgreSQL network discovery

From
Alvaro Herrera
Date:
Gevik Babakhani wrote:
> Hi,
> 
> There is a nice little feature within MSSQL where it is possible to
> enumerate all MSSQL servers on the local network. 
> I wonder how this can be made possible with PG. Pinging every IP:PGPORT
> within the current subnet is one of the options but I guess that would be
> just a bad solution.  Any thoughts?

We have rendezvous support too.  We need to update it to use the newer
Avahi library, but the one person who proposed using the thread
interface got scolded for that and fled :-)  The interface we'd need to
use is complex and the patch would be a lot bigger.

If you want to work on it, you're welcome to do so :-)

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


Re: PostgreSQL network discovery

From
"Gevik Babakhani"
Date:
If I am not mistaken, it only works fine on OSX environments. (I might be
very wrong here) 

> -----Original Message-----
> From: Magnus Hagander [mailto:magnus@hagander.net] 
> Sent: Wednesday, October 29, 2008 8:47 PM
> To: Gevik Babakhani
> Cc: 'PGSQL Hackers'
> Subject: Re: [HACKERS] PostgreSQL network discovery
> 
> Gevik Babakhani wrote:
> > Hi,
> > 
> > There is a nice little feature within MSSQL where it is possible to 
> > enumerate all MSSQL servers on the local network.
> > I wonder how this can be made possible with PG. Pinging every 
> > IP:PGPORT within the current subnet is one of the options 
> but I guess 
> > that would be just a bad solution.  Any thoughts?
> 
> Isn't the bonjour support supposed to do this?
> (Never used it myself though)
> 
> //Magnus



Re: PostgreSQL network discovery

From
"Gevik Babakhani"
Date:
I asked this question because I have a situation where a service like this
would be very useful. If such a functionality would be accepted by the core
team, I am willing to work on it.

> -----Original Message-----
> From: Alvaro Herrera [mailto:alvherre@commandprompt.com] 
> Sent: Wednesday, October 29, 2008 8:50 PM
> To: Gevik Babakhani
> Cc: 'PGSQL Hackers'
> Subject: Re: [HACKERS] PostgreSQL network discovery
> 
> Gevik Babakhani wrote:
> > Hi,
> > 
> > There is a nice little feature within MSSQL where it is possible to 
> > enumerate all MSSQL servers on the local network.
> > I wonder how this can be made possible with PG. Pinging every 
> > IP:PGPORT within the current subnet is one of the options 
> but I guess 
> > that would be just a bad solution.  Any thoughts?
> 
> We have rendezvous support too.  We need to update it to use 
> the newer Avahi library, but the one person who proposed 
> using the thread interface got scolded for that and fled :-)  
> The interface we'd need to use is complex and the patch would 
> be a lot bigger.
> 
> If you want to work on it, you're welcome to do so :-)
> 
> -- 
> Alvaro Herrera                                
> http://www.CommandPrompt.com/
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
> 



Re: PostgreSQL network discovery

From
Tom Lane
Date:
"Gevik Babakhani" <pgdev@xs4all.nl> writes:
> I asked this question because I have a situation where a service like this
> would be very useful. If such a functionality would be accepted by the core
> team, I am willing to work on it.

The existing code uses APIs that Apple has deprecated, so it's going to
need to be fixed sooner or later.  The issue isn't whether to fix it,
it's how to not introduce any unwanted dependencies (like threading...)
        regards, tom lane