Unix Technical Forum

remote connections to Windows based server

This is a discussion on remote connections to Windows based server within the pgsql Admins forums, part of the PostgreSQL category; --> I am running the pre-built Windows version of postgresql 8.1. I have a local LAN with a 10.6/16 network. ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 07:50 AM
Paul Forgey
 
Posts: n/a
Default remote connections to Windows based server

I am running the pre-built Windows version of postgresql 8.1. I have
a local LAN with a 10.6/16 network. Apparently there's something more
than what's in the FAQ or my interpretation of the manual to get
remote connections working.

pg_hba.conf:
host all all 10.6/16 md5
host all all 127.0.0.1/32 md5

postgresql.conf:
listen_address = '*'

C:] psql -U postgres -d postgres -h swift
psql: FATAL: no pg_hba.conf entry for host "10.6.1.226", user
"postgres", database "postgres", SSL off

C:] psql -U postgres -d postgres
Password for user postgres:

If I remove the 127.0.0.1 line from pg_hba.conf, I cannot connect at
all.

What more do I need to do?


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 07:50 AM
Jeff Frost
 
Posts: n/a
Default Re: remote connections to Windows based server

On Fri, 17 Nov 2006, Paul Forgey wrote:

> I am running the pre-built Windows version of postgresql 8.1. I have a local
> LAN with a 10.6/16 network. Apparently there's something more than what's in
> the FAQ or my interpretation of the manual to get remote connections working.
>
> pg_hba.conf:
> host all all 10.6/16 md5
> host all all 127.0.0.1/32 md5


Paul,

Did you try:
host all all 10.6.0.0/16 md5

?

I believe you must list all 4 octets of the subnet. It says this in the docs:

The mask length indicates the number of high-order bits of the client IP
address that must match. Bits to the right of this must be zero in the given
IP address.

Which tells me the 0s have to be there.

--
Jeff Frost, Owner <jeff@frostconsultingllc.com>
Frost Consulting, LLC http://www.frostconsultingllc.com/
Phone: 650-780-7908 FAX: 650-649-1954

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 07:50 AM
Tom Lane
 
Posts: n/a
Default Re: remote connections to Windows based server

Paul Forgey <paulf@aphrodite.com> writes:
> I am running the pre-built Windows version of postgresql 8.1. I have
> a local LAN with a 10.6/16 network. Apparently there's something more
> than what's in the FAQ or my interpretation of the manual to get
> remote connections working.


> pg_hba.conf:
> host all all 10.6/16 md5
> host all all 127.0.0.1/32 md5


> postgresql.conf:
> listen_address = '*'


> C:] psql -U postgres -d postgres -h swift
> psql: FATAL: no pg_hba.conf entry for host "10.6.1.226", user
> "postgres", database "postgres", SSL off


Hm, that sure looks like it should work, or at least not fail in that
particular way. Are you sure you restarted or SIGHUP'd the postmaster
after setting up the pg_hba.conf file?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-10-2008, 07:50 AM
Tom Lane
 
Posts: n/a
Default Re: remote connections to Windows based server

Jeff Frost <jeff@frostconsultingllc.com> writes:
> I believe you must list all 4 octets of the subnet.


Oh, duh. The comments in inet_aton() show that it is interpreting
"10.6" in what most people nowadays would find a surprising way:

case 1: /* a -- 32 bits */
case 2: /* a.b -- 8.24 bits */
case 3: /* a.b.c -- 8.8.16 bits */
case 4: /* a.b.c.d -- 8.8.8.8 bits */

ie, it is read as if it were "10.0.0.6" ... hence no match, but also no
syntax error.

regards, tom lane

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

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-10-2008, 07:51 AM
Tom Lane
 
Posts: n/a
Default Re: remote connections to Windows based server

Jeff Frost <jeff@frostconsultingllc.com> writes:
> Paul, just add the 0s and you'll be golden.


I've tweaked the SGML docs to make it clearer that omitting trailing
zeroes here isn't a good idea.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-10-2008, 07:51 AM
Paul Forgey
 
Posts: n/a
Default Re: remote connections to Windows based server

On Nov 17, 2006, at 2:41 PM, Jeff Frost wrote:

> On Fri, 17 Nov 2006, Paul Forgey wrote:
>
>> I am running the pre-built Windows version of postgresql 8.1. I
>> have a local LAN with a 10.6/16 network. Apparently there's
>> something more than what's in the FAQ or my interpretation of the
>> manual to get remote connections working.
>>
>> pg_hba.conf:
>> host all all 10.6/16 md5
>> host all all 127.0.0.1/32 md5

>
> Paul,
>
> Did you try:
> host all all 10.6.0.0/16 md5
>
> ?
>
> I believe you must list all 4 octets of the subnet. It says this
> in the docs:
>
> The mask length indicates the number of high-order bits of the
> client IP address that must match. Bits to the right of this must
> be zero in the given IP address.
>
> Which tells me the 0s have to be there.
>


D'oh yes, I overlooked that. specifying 10.6.0.0 worked.

Thank you.


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:49 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com