Skip site navigation (1) Skip section navigation (2)

can't create db from PHP

From: Enrico Ortmann <pg(dot)admin(at)radax(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: can't create db from PHP
Date: 2004-01-16 10:29:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
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]
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= 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



pgsql-admin by date

Next:From: Chris GamacheDate: 2004-01-16 13:34:17
Subject: Protect pg_xlog ?
Previous:From: tetsu_nagayamaDate: 2004-01-16 01:41:40
Subject: Re: cannt configure postgresql-7.4.1 on Solaris9

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group