From: Guido Barosio <gbarosio@gmail.com>
To: Karthik.S <skarthik@midascomm.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: error while creating database
Date: Tue, 6 Dec 2005 15:55:16 +0000
Message-ID: <f7f6b4c70512060755y57992f0ch9c7d636d2ea22192@mail.gmail.com> (raw)
In-Reply-To: <4395852E.5050802@midascomm.com>
References: <4395852E.5050802@midascomm.com>
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 <skarthik@midascomm.com> 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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: gbarosio@gmail.com, skarthik@midascomm.com
Subject: Re: error while creating database
In-Reply-To: <f7f6b4c70512060755y57992f0ch9c7d636d2ea22192@mail.gmail.com>
References: <4395852E.5050802@midascomm.com> <f7f6b4c70512060755y57992f0ch9c7d636d2ea22192@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox