Re: Multiple backend connections

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Multiple backend connections
Date: 2003-03-20 04:14:43
Message-ID: m3r8928yj0.fsf@varsoon.wireboard.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Paul M Foster <paulf(at)quillandmouse(dot)com> writes:

> On Wed, Mar 19, 2003 at 06:39:06PM -0500, Doug McNaught wrote:
>
> > Paul M Foster <paulf(at)quillandmouse(dot)com> writes:
> >
> > What is the exact error you're getting in the C program?
>
> Well, in a C program, you don't get an error message per se. But I
> inserted a call to PQresultErrorMessage() and the result is:
>
> ERROR: CREATE DATABASE: source database "template1" is being accessed by
> other users

Yeah, I get the same thing if I sit in template1 and try to 'createdb'
in another window. I think the answer is "don't do that then."

I don't know why it cares, but it obviously does. template1 is copied
when a new DB is created, but I'd think as long as there are no
transactions open on it, it'd be safe to copy even if someone is
connected to it. I'm probably wrong though.

Solution: don't use template1 for anything, and avoid connecting to it
if you want CREATE DATABASE to succeeed.

> P.S. BTW, I'm s*bscr*bed, so no need to echo lists posts offlist to me.

Habit, from back when the list used to take hours to deliver
messages...

-Doug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-03-20 04:35:53 Re: Multiple backend connections
Previous Message Stephan Szabo 2003-03-20 04:10:22 Re: trigger troubles