From: | Paul M Foster <paulf(at)quillandmouse(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Multiple backend connections |
Date: | 2003-03-20 03:10:20 |
Message-ID: | 20030320031020.GB6807@quillandmouse.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, Mar 19, 2003 at 06:39:06PM -0500, Doug McNaught wrote:
> Paul M Foster <paulf(at)quillandmouse(dot)com> writes:
>
> > I've written code to connect to and/or create databases in C. To check
> > my work, I'll open up psql in another console. But if I'm connected to
> > the default database (template1), and attempt to connect to that
> > database in my C program, it fails.
>
> This shouldn't happen, unless you're at your connection limit for
> Postgres (32 by default), or running out of kernel file descriptors or
> something.
>
> 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
The circumstances are that in one console, I'm connected in psql to the
template1 database. In a different console (same username) my C program
attempts to connect to a non-existent database. Failing this, it then
attempts to connect to template1 in order to create the other database.
But it can't connect to template1.
This is a Debian 3.0r1 workstation, running PostgreSQL 7.2.1.
Paul
P.S. BTW, I'm s*bscr*bed, so no need to echo lists posts offlist to me.
From | Date | Subject | |
---|---|---|---|
Next Message | Jessie Hui | 2003-03-20 03:56:32 | About tcp connection |
Previous Message | Christopher Kings-Lynne | 2003-03-20 02:12:18 | Re: MySQL at .NET conference |