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 7692B9DCAB0 for ; Tue, 6 Dec 2005 14:01:03 -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 54436-01 for ; Tue, 6 Dec 2005 14:01:02 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.199]) by postgresql.org (Postfix) with ESMTP id C30B39DD606 for ; Tue, 6 Dec 2005 14:00:59 -0400 (AST) Received: by zproxy.gmail.com with SMTP id o1so129211nzf for ; Tue, 06 Dec 2005 10:00:57 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PWuIib2WR/VHyvBiTV21nNF6dU0XSS69LYwmaA4z6XPW9XubtF7D6PA9SSWIOvkY9kBs90V9aAz1rGRHqh0o82nWZa2N0MmVmpKZvUrYIU0DfR077Zlj6vYc+YdAHWF2veWzLUr+9AB7TyISYiORUy4lvKNWsaECbPutS7YlMW0= Received: by 10.65.59.4 with SMTP id m4mr784879qbk; Tue, 06 Dec 2005 10:00:57 -0800 (PST) Received: by 10.65.196.9 with HTTP; Tue, 6 Dec 2005 10:00:57 -0800 (PST) Message-ID: <45dd8dbe0512061000o674ca409k2b000e94c0ad315@mail.gmail.com> Date: Tue, 6 Dec 2005 15:00:57 -0300 From: Dario Brignardello To: "Karthik.S" Subject: Re: error while creating database Cc: pgsql-admin@postgresql.org In-Reply-To: <4395852E.5050802@midascomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4395852E.5050802@midascomm.com> 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/37 X-Sequence-Number: 19757 Greetings: I may be wrong, but you could try using the createdb / dropdb utils from the pgsql/bin directory, or calling psql with some of the parameters used by such tools (-c -d , etc). Hope it helps. Best regards Dario 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 > -- Atte: Dario Brignardello