pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Enrico Ortmann <pg.admin@radax.net>
To: pgsql-admin@postgresql.org
Subject: can't create db from PHP
Date: Fri, 16 Jan 2004 11:29:51 +0100
Message-ID: <339131515.20040116112951@radax.net> (raw)

Hello admins,

I got a strange problem while creating a database FROM PHP:

I connect from SuSE shell via php to a PG-server [7.3.2] using command
$conn = @pg_pconnect("host=db port=5432 user=postgres dbname=template1");
[db is an Alias in /etc/hosts an points to 192.168.0.200]
Then I create a database using command
pg_exec($conn,"CREATE DATABASE dvl_ao_27_beta;");


All works fine!


But when I connect using the IP-adress instead of the alias
$conn = @pg_pconnect("host=192.168.0.200 port=5432 user=postgres dbname=template1");
the handle is valid as well, but then if I want to create the database I got the error
ERROR:  CREATE DATABASE: source database "template1" is being accessed by other users

Does anybody have an idea what goes wrong in case I use the IP?


Enrico Ortmann

----------------------------------------




view thread (2+ messages)  latest in thread

Message-ID: <339131515.20040116112951@radax.net>
Permalink:  ../339131515.20040116112951@radax.net/
Also on:    postgresql.org/message-id/339131515.20040116112951@radax.net

 · 

reply

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: pg.admin@radax.net
  Subject: Re: can't create db from PHP
  In-Reply-To: <339131515.20040116112951@radax.net>
  References: <339131515.20040116112951@radax.net>

* 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