Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C1D1F6504C4 for ; Tue, 22 Jul 2008 18:03:03 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 72798-04-2 for ; Tue, 22 Jul 2008 18:02:48 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29]) by postgresql.org (Postfix) with ESMTP id 9CA3B650539 for ; Tue, 22 Jul 2008 17:35:28 -0300 (ADT) Received: by yw-out-2324.google.com with SMTP id 3so796181ywj.73 for ; Tue, 22 Jul 2008 13:35:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ihI9lexvvZPDhWlqRBy7SL6hBWfRNfsCvheRN0t/JKA=; b=VCmR2gb3z3HlnpmfJxgdOTk5eZLrZpE5TnCU4ppPKOgPoib+8ipNszT0LiARtynBD1 Iy/kCziyyRuxAG5MXtRB+LvqpOQuKtR2nJN53ScJTqKqOWoA493OnQA8sHmKguqU/Jgo sJra5WeN/4wNIxOx1IoGMEbKIzpOWE5YpM3WM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ZcoloV32zImCL0i8XGP2daXpofebFdEMUY5nUUt1RwUl/MJb5tFFIS0eXZr0UDVibH rntSIwIXq8YjlIA5EHMxtn7gPhBLtyZJEoQPex4kiWQo21gp9RryQilLgQJ3InlLkIcn ymgGFmgPHiB3EXjRW2wfTmDTecpYdpUhbBO4A= Received: by 10.142.215.5 with SMTP id n5mr2028208wfg.131.1216758926665; Tue, 22 Jul 2008 13:35:26 -0700 (PDT) Received: by 10.142.242.21 with HTTP; Tue, 22 Jul 2008 13:35:26 -0700 (PDT) Message-ID: Date: Tue, 22 Jul 2008 13:35:26 -0700 From: "Jeffrey Baker" To: "Greg Sabino Mullane" Subject: Re: Perl/DBI vs Native Cc: pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <698916.49812.qm@web25803.mail.ukl.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200807/210 X-Sequence-Number: 30810 On Tue, Jul 22, 2008 at 9:48 AM, Greg Sabino Mullane 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