pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
can't connect via jdbc
2+ messages / 2 participants
[nested] [flat]

* can't connect via jdbc
@ 1999-01-16 21:43  Jonathan Sand <sand@gizmolab.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Jonathan Sand @ 1999-01-16 21:43 UTC (permalink / raw)
  To: pgsql-interfaces

If some kind soul could help straighten me out... :)

I recently installed Red Hat Linux 5.2, along with postgresql 6.3.2 
(rpm). The postmaster is running, started from the 
/etc/rc.d/init.d/postgresql script, which I changed so that the backend 
runs in verbose mode, produces debugging output and redirects output to a 
log file:

su postgres -c '/usr/bin/postmaster -d 9 -p 2002 -D/var/lib/pgsql > 
/var/lib/pgsql/log/pg_log 2>&1 &'

After running this script, the log file contains startup output. I can 
run the psql monitor and do normal SQL things on the redhat machine. What 
I can't seem to do is connect to postgres from another machine. I've 
written a java program which does a connect, using JDBC. This works fine 
connecting to postgresql 6.3.2 running on a Slakware Linux machine. I 
believe I've configured postgres to accept connections from my other 
machine, adding the following line to pg_hba.conf:

host  all  193.1.1.0  255.255.255.240  trust

The redhat machine is 193.1.1.2 and the other machine is 193.1.1.4. These 
are local ip addresses, only valid on my side of an ISDN router.

I've added the java program's user name to pg_user, and granted that user 
full access. I do a connect from the other machine; the log file shows no 
output relating to this attempted connection. Thinking it might be a port 
problem, I ran tcpdump. I'm not an expert in interpreting its output, but 
the ethernet traffic looks like a valid request was made from the other 
machine to the correct port and acknowledged by the redhat machine from 
the correct port. I can telnet as the java user from the other machine to 
the redhat machine and run psql, so my access is at least configured that 
far.

Can anybody tell me what vital bits am I missing in my configuration?

Thank you,


Jonathan Sand

sand@gizmolab.com

Hardware: n. that aspect of a computer system which can be hit.





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: [INTERFACES] can't connect via jdbc
@ 1999-01-16 22:32  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Jonathan Sand <sand@gizmolab.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 1999-01-16 22:32 UTC (permalink / raw)
  To: Jonathan Sand <sand@gizmolab.com>; +Cc: pgsql-interfaces

Jonathan Sand <sand@gizmolab.com> writes:
> If some kind soul could help straighten me out... :)

> su postgres -c '/usr/bin/postmaster -d 9 -p 2002 -D/var/lib/pgsql > 
> /var/lib/pgsql/log/pg_log 2>&1 &'

You forgot the -i switch ... so the postmaster is not listening for TCP
connections, only local Unix-socket connections.

Note to postgres crew: I think we ought to think about changing the
postmaster switches so that -i is default behavior, and you have to
supply some other switch if you want to *turn off* TCP access.  This
Question is far too Frequently Asked...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~1999-01-16 22:32 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-01-16 21:43 can't connect via jdbc Jonathan Sand <sand@gizmolab.com>
1999-01-16 22:32 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox