pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feederror while creating database
4+ messages / 4 participants
[nested] [flat]
* error while creating database
@ 2005-12-06 12:33 Karthik.S <skarthik@midascomm.com>
2005-12-06 15:55 ` Re: error while creating database Guido Barosio <gbarosio@gmail.com>
2005-12-06 18:00 ` Re: error while creating database Dario Brignardello <dbrignar@gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Karthik.S @ 2005-12-06 12:33 UTC (permalink / raw)
To: pgsql-admin
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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: error while creating database
2005-12-06 12:33 error while creating database Karthik.S <skarthik@midascomm.com>
@ 2005-12-06 15:55 ` Guido Barosio <gbarosio@gmail.com>
2005-12-06 20:31 ` Re: error while creating database Jim C. Nasby <jim@nasby.net>
1 sibling, 1 reply; 4+ messages in thread
From: Guido Barosio @ 2005-12-06 15:55 UTC (permalink / raw)
To: Karthik.S <skarthik@midascomm.com>; +Cc: pgsql-admin
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.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: error while creating database
2005-12-06 12:33 error while creating database Karthik.S <skarthik@midascomm.com>
2005-12-06 15:55 ` Re: error while creating database Guido Barosio <gbarosio@gmail.com>
@ 2005-12-06 20:31 ` Jim C. Nasby <jim@nasby.net>
0 siblings, 0 replies; 4+ messages in thread
From: Jim C. Nasby @ 2005-12-06 20:31 UTC (permalink / raw)
To: Guido Barosio <gbarosio@gmail.com>; +Cc: Karthik.S <skarthik@midascomm.com>; pgsql-admin
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 <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.
--
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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: error while creating database
2005-12-06 12:33 error while creating database Karthik.S <skarthik@midascomm.com>
@ 2005-12-06 18:00 ` Dario Brignardello <dbrignar@gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: Dario Brignardello @ 2005-12-06 18:00 UTC (permalink / raw)
To: Karthik.S <skarthik@midascomm.com>; +Cc: pgsql-admin
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 <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
>
--
Atte: Dario Brignardello
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2005-12-06 20:31 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-06 12:33 error while creating database Karthik.S <skarthik@midascomm.com>
2005-12-06 15:55 ` Guido Barosio <gbarosio@gmail.com>
2005-12-06 20:31 ` Jim C. Nasby <jim@nasby.net>
2005-12-06 18:00 ` Dario Brignardello <dbrignar@gmail.com>
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