pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeffrey Baker <jwbaker@gmail.com>
To: Greg Sabino Mullane <greg@turnstep.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Perl/DBI vs Native
Date: Tue, 22 Jul 2008 13:35:26 -0700
Message-ID: <fd145f7d0807221335l3a105df4v1d963d981792b8b4@mail.gmail.com> (raw)
In-Reply-To: <dd0f5dcec7cfaac867cb7ce16c4ee3bf@biglumber.com>
References: <698916.49812.qm@web25803.mail.ukl.yahoo.com>
	<dd0f5dcec7cfaac867cb7ce16c4ee3bf@biglumber.com>

On Tue, Jul 22, 2008 at 9:48 AM, Greg Sabino Mullane <greg@turnstep.com> wrote:
>> In case someone is wondering, the way to force DBI to use unix
>> sockets is by not specifying a host and port in the connect call.
>
> Actually, the host defaults to the local socket. Using the port
> may still be needed: if you leave it out, it simply uses the default
> value (5432) if left out. Thus, for most purposes, just leaving
> the host out is enough to cause a socket connection on the default
> port.

For the further illumination of the historical record, the best
practice here is probably to use the pg_service.conf file, which may
or may not live in /etc depending on your operating system.  Then you
can connect in DBI using dbi:Pg:service=whatever, and change the
definition of "whatever" in pg_service.conf.  This has the same
semantics as PGSERVICE=whatever when using psql.  It's a good idea to
keep these connection details out of your program code.

-jwb



view thread (10+ messages)  latest in thread

Message-ID: <fd145f7d0807221335l3a105df4v1d963d981792b8b4@mail.gmail.com>
Permalink:  ../fd145f7d0807221335l3a105df4v1d963d981792b8b4@mail.gmail.com/
Also on:    postgresql.org/message-id/fd145f7d0807221335l3a105df4v1d963d981792b8b4@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jwbaker@gmail.com, greg@turnstep.com
  Subject: Re: Perl/DBI vs Native
  In-Reply-To: <fd145f7d0807221335l3a105df4v1d963d981792b8b4@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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