Thread: Re: Can't connect to Windows port + other
A few days ago there was a fellow that had trouble connecting remotely to the 8.0 beta win port. I had the same problem, but have since found the solution. In postgresql.conf file, ensure the line "listen_addresses" is set to '*', ie, listen_addresses = '*' This should do it. Can someone explain to my why this line is here? Wouldn't the settings in the pg_hba.conf file limit who is able to connect? If so, why not set the listen_addresses to '*' right away? Also, while I'm at it, one more question if I may... I'd like to be able to run a batch file to perform some tasks immediately following installation of the database. For example, createuser -U [super user name] -a -d [user name] but it always fails because I don't know how to add the password for the super user into the command line, and of course the super user will always have a password. Is there a way to do this? Much thanks to all.
"Anony Mous" <A.Mous@shaw.ca> writes: > A few days ago there was a fellow that had trouble connecting remotely to > the 8.0 beta win port. I had the same problem, but have since found the > solution. In postgresql.conf file, ensure the line "listen_addresses" is > set to '*', ie, > > listen_addresses = '*' > > This should do it. Can someone explain to my why this line is here? TCP/IP has always been disabled by default, leaving just Unix sockets for connections. This is probably not a very useful default configuration on Windows. :) -Doug -- Let us cross over the river, and rest under the shade of the trees. --T. J. Jackson, 1863
"Anony Mous" <A.Mous@shaw.ca> writes: > If so, why not set the listen_addresses to '*' right away? Security. It was difficult enough to get people to accept the current liberalized default --- I don't think they'll go for defaulting to -i, which is essentially what you're asking for. It's seen as a good thing that there are two, not one, levels of protection between you and having a database server that's wide open to the entire internet. > but it always fails because I don't know how to add the password for the > super user into the command line, and of course the super user will always > have a password. Is there a way to do this? Create a .pgpass file maybe? regards, tom lane
On Wed, 2004-09-01 at 16:12, Doug McNaught wrote: > "Anony Mous" <A.Mous@shaw.ca> writes: > > > A few days ago there was a fellow that had trouble connecting remotely to > > the 8.0 beta win port. I had the same problem, but have since found the > > solution. In postgresql.conf file, ensure the line "listen_addresses" is > > set to '*', ie, > > > > listen_addresses = '*' > > > > This should do it. Can someone explain to my why this line is here? > > TCP/IP has always been disabled by default, leaving just Unix sockets > for connections. This is probably not a very useful default > configuration on Windows. :) > > -Doug Heh, at least it makes the user learn how to configure their postgresql configuration. ;-) -Robby -- /*************************************** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | robby@planetargon.com * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting & Development ****************************************/
Attachment
Great, I found the part of the docs referring to this (ch 27.11) however, it refers to creating this file in the user's home directory. It seems this part of the documentation is assuming I'm using *nix. In Windows, where should this file be located? Also, .pgpass is an invalid file name in Win. Thanks! -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: September 1, 2004 5:19 PM To: Anony Mous Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Can't connect to Windows port + other "Anony Mous" <A.Mous@shaw.ca> writes: > If so, why not set the listen_addresses to '*' right away? Security. It was difficult enough to get people to accept the current liberalized default --- I don't think they'll go for defaulting to -i, which is essentially what you're asking for. It's seen as a good thing that there are two, not one, levels of protection between you and having a database server that's wide open to the entire internet. > but it always fails because I don't know how to add the password for the > super user into the command line, and of course the super user will always > have a password. Is there a way to do this? Create a .pgpass file maybe? regards, tom lane
Anony Mous wrote: > Great, I found the part of the docs referring to this (ch 27.11) however, it > refers to creating this file in the user's home directory. It seems this > part of the documentation is assuming I'm using *nix. In Windows, where > should this file be located? Also, .pgpass is an invalid file name in Win. What is invalid about it? Windows explorer tried to be cute and doesn't allow you to create it, but that doesn't stop you from creating it with another program. Also, windows has users home directories, so the .pgpass file would go there, perhaps: C:\Documents and Setting\postgres\.pgpass Matthew