Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 4FE69634162 for ; Fri, 2 Apr 2010 03:35:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 16342-03 for ; Fri, 2 Apr 2010 06:35:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from rs47.luxsci.com (rs47.luxsci.com [65.61.166.88]) by mail.postgresql.org (Postfix) with ESMTP id 938076321F7 for ; Fri, 2 Apr 2010 03:35:14 -0300 (ADT) Received: from gnanam (ABTS-TN-Static-186.58.165.122.airtelbroadband.in [122.165.58.186] (may be forged)) (authenticated bits=0) by rs47.luxsci.com (8.13.1/8.13.7) with ESMTP id o326Z8C3026613; Fri, 2 Apr 2010 01:35:11 -0500 Reply-To: From: "Gnanakumar" To: Subject: Database clone stuck in the middle Date: Fri, 2 Apr 2010 12:05:03 +0530 Organization: Zoniac Software Private Limited Message-ID: <009e01cad22e$a3121400$e9363c00$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcrSLp/lWa+DpjzGSlGrWqFJ5PUTfQ== Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.336 tagged_above=-10 required=5 tests=AWL=1.263, BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201004/7 X-Sequence-Number: 34101 Hi, I'm using PostgreSQL 8.2 on RedHat ES 5. I connect to our database which is hosted remotely using PuTTY thro SSH protocol. As part of my maintenance activity, I was cloning the database using the command: CREATE DATABASE newdb WITH TEMPLATE=olddb; While cloning was in-progress, my Internet got disconnected in the middle, so database cloning was also stuck in the middle. Then I again logged-in to my server and listed my databases using psql '\l' command. My newdb was not listed here, but a new database OID folder is created in the PostgreSQL data folder "/usr/local/pgsql/data/base/". My questions are: 1. Can I go ahead and delete this newdb-OID manually from this location using: rm -fr /usr/local/pgsql/data/base/ 2. Is there any implication to other databases because of manually deleting in this way? 3. Does PostgreSQL postmaster check for anything of this newdb-OID reference during start/stop/restart? 4. Considering this Internet disconnection problem, what is the safest way to clone a database using CREATE DATABASE WITH TEMPLATE command, so that this will not happen in the future?