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 86E399DD574 for ; Tue, 6 Dec 2005 16:31:10 -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 83135-04 for ; Tue, 6 Dec 2005 16:31:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 5ED9C9DCAA8 for ; Tue, 6 Dec 2005 16:31:07 -0400 (AST) Received: by flake.decibel.org (Postfix, from userid 1001) id 4FB2D152C1; Tue, 6 Dec 2005 14:31:08 -0600 (CST) Date: Tue, 6 Dec 2005 14:31:08 -0600 From: "Jim C. Nasby" To: Guido Barosio Cc: "Karthik.S" , pgsql-admin@postgresql.org Subject: Re: error while creating database Message-ID: <20051206203108.GH16053@nasby.net> References: <4395852E.5050802@midascomm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 4.11-RELEASE-p10 i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/40 X-Sequence-Number: 19760 I would also strongly recommend upgrading from 7.1.3. That version is over 3 years old, is no longer supported, and IIRC has known data integrity issues. On Tue, Dec 06, 2005 at 03:55:16PM +0000, Guido Barosio wrote: > Quote: > > "I am having a script(uses psql) which drops and creates a database by > logging > into 'template1'. This will be invoked from crontab." > > If you are actually connecting with this script into template1 before > running the create database, you will then receive that message. Ensure that > the script is not doing this, or create a new template2 database, to use as > a template, instead of the default one. > > My 2 cents. > > g.- > > On 12/6/05, Karthik.S wrote: > > > > 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 > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 6: explain analyze is your friend > > > > > > -- > "Adopting the position that you are smarter than an automatic > optimization algorithm is generally a good way to achieve less > performance, not more" - Tom Lane. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461