Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id BF278B5DC1E for ; Mon, 24 Oct 2011 19:41:14 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 07301-05 for ; Mon, 24 Oct 2011 22:41:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-gx0-f174.google.com (mail-gx0-f174.google.com [209.85.161.174]) by mail.postgresql.org (Postfix) with ESMTP id 77D0AB5DC04 for ; Mon, 24 Oct 2011 19:41:01 -0300 (ADT) Received: by ggnb1 with SMTP id b1so6215352ggn.19 for ; Mon, 24 Oct 2011 15:41:02 -0700 (PDT) Received: by 10.182.36.100 with SMTP id p4mr2939568obj.65.1319496062509; Mon, 24 Oct 2011 15:41:02 -0700 (PDT) Received: from Craig-Jamess-MacBook-Pro.local (wsip-70-167-122-86.sd.sd.cox.net. [70.167.122.86]) by mx.google.com with ESMTPS id m5sm658oba.6.2011.10.24.15.41.00 (version=SSLv3 cipher=OTHER); Mon, 24 Oct 2011 15:41:01 -0700 (PDT) Message-ID: <4EA5EA8E.5090406@emolecules.com> Date: Mon, 24 Oct 2011 15:45:34 -0700 From: Craig James User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: Dumping data using pg_dump after chrooting to a different partition References: <4EA5E253.6020600@cisco.com> In-Reply-To: <4EA5E253.6020600@cisco.com> Content-Type: multipart/alternative; boundary="------------000707020604070509070805" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201110/108 X-Sequence-Number: 38560 This is a multi-part message in MIME format. --------------000707020604070509070805 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 10/24/11 3:10 PM, Krishnamurthy Radhakrishnan wrote: > Hi, > > I am new to PostgreSQL. We are using PostgreSQL 9.0.2 on our linux server. We have an instance of PostgreSQL 9.0 running using the primary partition on the server. > > We want to use the pg_dump and psql programs to migrate the data during our software upgrade process. For upgrade, we plan to do the following: > > * chroot to a secondary partition on the server. > * install the software RPMs including PostgreSQL RPMs > * start a secondary instance of PostgreSQL DB server using a different port and data directory. > * run pg_dump to dump the data from the primary instance to a file. > * run psql to import the data from the file into the secondary instance. > > However when I tried to perform the pg_dump as mentioned above, I get the following error: > pg_dump: [archiver (db)] connection to database "TestDB" failed: could not connect to server: No such file or directory| > Is the server running locally and accepting| > connections on Unix domain socket "/tmp/.s.PGSQL.5432"?| I suspect the problem is that localhost sockets on Unix/Linux are actual implemented as file-system sockets rather than TCP/IP sockets. If you do chroot, those files won't exist. Try connecting using a "-h hostname (e.g. -h myserver.domain.com) rather than the default localhost. You may have to reconfigure your server to listen on port 80. Craig --------------000707020604070509070805 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 10/24/11 3:10 PM, Krishnamurthy Radhakrishnan wrote:
Hi,

I am new to PostgreSQL. We are using PostgreSQL 9.0.2 on our linux server. We have an instance of PostgreSQL 9.0 running using the primary partition on the server.

We want to use the pg_dump and psql programs to migrate the data during our software upgrade process. For upgrade, we plan to do the following:
  • chroot to a secondary partition on the server.
  • install the software RPMs including PostgreSQL RPMs
  • start a secondary instance of PostgreSQL DB server using a different port and data directory.
  • run pg_dump to dump the data from the primary instance to a file.
  • run psql to import the data from the file into the secondary instance.
However when I tried to perform the pg_dump as mentioned above, I get the following error:
pg_dump: [archiver (db)] connection to database "TestDB" failed: could not connect to server: No such file or directory|<LVL::Debug>
Is the server running locally and accepting|<LVL::Debug>
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?|<LVL::Debug>
I suspect the problem is that localhost sockets on Unix/Linux are actual implemented as file-system sockets rather than TCP/IP sockets.  If you do chroot, those files won't exist.  Try connecting using a "-h hostname (e.g. -h myserver.domain.com) rather than the default localhost.  You may have to reconfigure your server to listen on port 80.

Craig
--------------000707020604070509070805--