Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 122B2B5DD91 for ; Tue, 25 Oct 2011 00:01:59 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 20409-02 for ; Tue, 25 Oct 2011 03:01:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mtv-iport-3.cisco.com (mtv-iport-3.cisco.com [173.36.130.14]) by mail.postgresql.org (Postfix) with ESMTP id 4782BB5DD8D for ; Tue, 25 Oct 2011 00:01:51 -0300 (ADT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=kradhak@cisco.com; l=5531; q=dns/txt; s=iport; t=1319511712; x=1320721312; h=message-id:date:from:mime-version:to:cc:subject: references:in-reply-to; bh=rd/kalw7FbYyAJt49DDaVeBuWu1aaK7/f6vwuMChM3c=; b=Bs/TK3cNiJvQqfD6LboaPi+kPhuXias7f2XNZF/GE9WOD4AXUF6ZPHJb jDgawV26yWM7x2ny3gSsCtvGmIf/bd/lm3IHmY3pvaKZI+6wfVdFm7LhN HDOagTNsRBG9dLXXlZKpKeIC0A8BkCsVgGknNPRH/mSvyPE1fRjzEuTyt E=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah0FAM8lpk6rRDoJ/2dsb2JhbABDplKCQ4EFgW4BAQEBAxIBZQEQCwQUCRYPCQMCAQIBRQYNAQcBAR6eAwGeTIhABIgGjAOFLAmDNIkR X-IronPort-AV: E=Sophos;i="4.69,402,1315180800"; d="scan'208,217";a="10020682" Received: from mtv-core-4.cisco.com ([171.68.58.9]) by mtv-iport-3.cisco.com with ESMTP; 25 Oct 2011 03:01:49 +0000 Received: from xbh-sjc-221.amer.cisco.com (xbh-sjc-221.cisco.com [128.107.191.63]) by mtv-core-4.cisco.com (8.14.3/8.14.3) with ESMTP id p9P31mQw006169; Tue, 25 Oct 2011 03:01:48 GMT Received: from xfe-sjc-232.amer.cisco.com ([128.107.191.79]) by xbh-sjc-221.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 24 Oct 2011 20:01:48 -0700 Received: from [192.168.1.105] ([10.89.13.85]) by xfe-sjc-232.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 24 Oct 2011 20:01:47 -0700 Message-ID: <4EA6269A.7040803@cisco.com> Date: Mon, 24 Oct 2011 21:01:46 -0600 From: Krishnamurthy Radhakrishnan 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: Craig James CC: pgsql-admin@postgresql.org Subject: Re: Dumping data using pg_dump after chrooting to a different partition References: <4EA5E253.6020600@cisco.com> <4EA5EA8E.5090406@emolecules.com> In-Reply-To: <4EA5EA8E.5090406@emolecules.com> Content-Type: multipart/alternative; boundary="------------040506060109010801030202" X-OriginalArrivalTime: 25 Oct 2011 03:01:47.0535 (UTC) FILETIME=[6F4A41F0:01CC92C2] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.403 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/112 X-Sequence-Number: 38564 This is a multi-part message in MIME format. --------------040506060109010801030202 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Thanks Craig. After configuring to accept TCP connections on port 5432, I tried to specify the hostname as shown below and that didn't help. Is there anything else that needs to be configured? pg_dump -h bldr-ccm36.cisco.com -p 5432 -a -U postgres pg_dump: [archiver (db)] connection to database "postgres" failed: could not connect to server: Connection refused Is the server running on host "bldr-ccm36.cisco.com" and accepting TCP/IP connections on port 5432? Radha On 10/24/11 4:45 PM, Craig James wrote: > 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 --------------040506060109010801030202 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks Craig.

After configuring to accept TCP connections on port 5432, I tried to specify the hostname as shown below and that didn't help. Is there anything else that needs to be configured?
pg_dump -h bldr-ccm36.cisco.com -p 5432 -a -U postgres
pg_dump: [archiver (db)] connection to database "postgres" failed: could not connect to server: Connection refused
    Is the server running on host "bldr-ccm36.cisco.com" and accepting
    TCP/IP connections on port 5432?

Radha

On 10/24/11 4:45 PM, Craig James wrote:
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

--------------040506060109010801030202--