Re: createdb problem

From: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: createdb problem
Date: 2003-10-14 16:11:11
Message-ID: 200310141711.11203.gary.stainburn@ringways.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Tuesday 14 Oct 2003 4:32 pm, Gary Stainburn wrote:
> Hi folks,
>
> I've got two totally seperate databases that I'm working on at the moment,
> the only thing they have in common is the server that they're on
> (RH7.3+Errata)
>
> For each of these databases I have a file containing the SQL commands to
> create and populate the various tables, and bash script which simply calls
>
> dropdb $dbname
> createdb $dbname
> psql <$dbname.sql
>
> However, for the last few days, this script seems to be alternating between
> working and not working, the sequence being:
>
[snip]

Me again,

I've found that if I add a 'sleep 1' between the dropdb and createdb, that the
script works every time.

Am I right in thinking that dropdb actually connects using the template1
database to enable it to work, and that the connection is not closing quick
enough when dropdb finishes, thus causing the problem? If so:

1) why does this connection not fully drop before dropdb exits?
2) as createdb is only cloning template1, why does it need exclusive access?
3) other than the frig used above, how can this be fixed?

Also, I still don't know why this has just started happening, as nothing major
has happened to the server for a while, and the workload hasn't significantly
increased.

Gary

--
Gary Stainburn

This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Oliver Elphick 2003-10-14 16:27:53 Re: Lock!
Previous Message Gary Stainburn 2003-10-14 15:32:52 createdb problem