Re: authentication

From: Barry Lind <blind(at)xythos(dot)com>
To: Chris Faulkner <chrisf(at)oramap(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: authentication
Date: 2003-09-23 16:01:13
Message-ID: 3F706E49.1090003@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-cygwin pgsql-jdbc

Chris,

You can't do what you are trying to do with java. Java does not support
a non-portable concept like unix sockets. So the only way to connect to
postgres from jdbc is through tcpip.

The two jdbc connection URLs you give below are identical in
functionality. If you don't specify the machine and port in the URL it
uses the default values of localhost and 5432.

thanks,
--Barry

Chris Faulkner wrote:
> Hello
>
> I am using postgres in the cygwin environment. I have two services set up -
> one launches it with no networking and one with networking so that it runs
> on port 5432. Both are fine in terms of the service and I can connect with
> psql with both. However, I need to connect with a JDBC connection. I can get
> the JDBC connection to work with networking but not without. SInce my Java
> app always runs locally, I would like to leave the networking off.
>
> The connection parameter for networking (all OK with this one)
> <init-param url="jdbc:postgresql://localhost:5432/template1"/>
>
> With no networking, it is as follows (doesn't connect)
> <init-param url="jdbc:postgresql:template1"/>
>
> I have read threads elsewhere which seem to suggest that it can be made to
> work like this - any ideas anyone ?
>
> The second part to this is about authentication. I would like to connect
> with a low-privileged user, but all users should use a password. This is my
> only entry in /usr/share/postgresql/pg_hba.conf
>
> # TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
> local all all password
>
> WHatever change I make to this, psql never prompts when running on the same
> machine. Does cygwin support pg_hba.conf ? If I use psql with -U and -W, I
> get prompted for a password but it lets me in whatever I type.
>
> Thanks for ANY help or pointers.
>
> Chris
>
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

In response to

Responses

Browse pgsql-cygwin by date

  From Date Subject
Next Message Chris Faulkner 2003-09-23 17:15:42 Re: authentication
Previous Message Chris Faulkner 2003-09-23 13:49:43 authentication

Browse pgsql-jdbc by date

  From Date Subject
Next Message Barry Lind 2003-09-23 16:06:17 Re: java.net.SocketException: Broken pipe
Previous Message Chris Faulkner 2003-09-23 13:49:43 authentication