X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 95BF79DD612 for ; Tue, 6 Dec 2005 11:27:54 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 27253-09-3 for ; Tue, 6 Dec 2005 11:27:56 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by postgresql.org (Postfix) with ESMTP id 15C4F9DCCC3 for ; Tue, 6 Dec 2005 11:27:48 -0400 (AST) Received: from info.midascomm.com (unknown [203.196.171.91]) by svr2.postgresql.org (Postfix) with ESMTP id DABA9F119A for ; Tue, 6 Dec 2005 12:13:21 +0000 (GMT) Received: from [192.168.13.107] ([192.168.13.107]) by info.midascomm.com (8.12.10/8.12.10) with ESMTP id jB6CGikO004188 for ; Tue, 6 Dec 2005 17:46:44 +0530 Message-ID: <4395852E.5050802@midascomm.com> Date: Tue, 06 Dec 2005 18:03:50 +0530 From: "Karthik.S" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040805 Netscape/7.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: error while creating database Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-midascomm.com-MailScanner-Information: Please contact the ISP for more information X-midascomm.com-MailScanner: Found to be clean X-midascomm.com-MailScanner-From: skarthik@midascomm.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.332 required=5 tests=[RCVD_IN_BL_SPAMCOP_NET=1.332] X-Spam-Score: 1.332 X-Spam-Level: * X-Archive-Number: 200512/34 X-Sequence-Number: 19754 Dear all, I am using postgres version: 7.1.3 in Red hat linux : 7.2. I am having a script(uses psql) which drops and creates a database by logging into 'template1'. This will be invoked from crontab. Sometimes (nearly 50% of the times) the database creation fails by saying "ERROR: CREATE DATABASE: source database "template1" is being accessed by other users" But I am sure that none of my scripts access 'template1' at that time. I have also checked the 'ps -afx' output (logged at the time of failing), but no suspects found. Kindly give me a solution to overcome this problem. Also kindly tell me a way to find, which process is accessing the template1. Thanks in advance. regards KArthik.S