On Fri, 2013-07-19 at 17:33 +0200, Cédric Krier wrote:

> On 19/07/13 09:27 -0600, Mark Hayden (local) wrote:
> > On Fri, 2013-07-19 at 14:54 +0200, Axel Braun wrote:
> > There is more to it than pg_hba however.  If you notice in the comments
> > of this file it subtly reminds you of this.  Besides the host-based-auth
> > of this file you have to ensure postgresql is listening on TCP sockets
> > or it won't matter if the IP address or subnet is configured here (it
> > will only listen on a UNIX socket file and look at the rule for "local"
> > which is using "peer" auth methof here--maybe changing that to MD5 would
> > work?).  I am not certain that Tryton connects to unix sockets--I think
> > even for local databases it uses localhost TCP socket (can the gurus
> > here confirm that?).
> 
> If you define no host nor port, normally psycopg2 will use unix socket.
> 

That is good to know.  That would mean host and port are optional.
Never wondered about that myself as I connect to separate database
server.


> > > # Configure the database connection
> > > ## Note: Only databases owned by db_user will be displayed in the 
> > > connection 
> > > dialog
> > > ## of the Tryton client. db_user must have create permission for new 
> > > databases
> > > ## to be able to use automatic database creation with the Tryton client.
> > > #db_host = False
> > > #db_port = False
> > > #db_user = False
> > > #db_password = False
> > 
> > I am pretty sure the above four DB_* parameters are NOT optional, even
> > for local databases.  I do not know the default values for these if they
> > are optional.  So, to be safe I would suggest you explicitly supply them
> > as such:
> > 
> > db_host = 127.0.0.1 # the hostname localhost should work here too--if it
> > doesn't you'd have bigger problems ;-)
> > db_port = 5432
> 
> Only if you want to use TCP socket.

That makes sense.  How about username and password?  Axel's file had
"peer" for auth method in pg_hba for "local" (unix socket) connections
which would get the user name from the OS--presumably the user account
running the trytond process.  If no user name or password are supplied
in the Tryton config would that be the assumed setup?  In that case I
would guess that without any DB settings in the Tryton config file that
a person could handle this by making sure trytond is running under a
user account with the same name as the database owner in PostgreSQL.

(I apologise for the questions--I forsee a situation where I may install
a small/single-server in the future here...)

> 

Reply via email to