pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedcan't create db
2+ messages / 1 participants
[nested] [flat]
* can't create db
@ 2004-01-16 10:30 Enrico Ortmann <pg.php@radax.net>
2004-01-19 08:27 ` Re: can't create db Enrico Ortmann <pg.php@radax.net>
0 siblings, 1 reply; 2+ messages in thread
From: Enrico Ortmann @ 2004-01-16 10:30 UTC (permalink / raw)
To: pgsql-php
Hello proggers,
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
----------------------------------------
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: can't create db
2004-01-16 10:30 can't create db Enrico Ortmann <pg.php@radax.net>
@ 2004-01-19 08:27 ` Enrico Ortmann <pg.php@radax.net>
0 siblings, 0 replies; 2+ messages in thread
From: Enrico Ortmann @ 2004-01-19 08:27 UTC (permalink / raw)
To: pgsql-php
Hi Mariusz,
MP> Thus there may be two connections (two users) to the template1 database.
MP> Just try the same actions with pg_connect.
Thanks, that seems to be the cause of the problem,
'cause I got no errors using pg_connect.
Rico
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-01-19 08:27 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-01-16 10:30 can't create db Enrico Ortmann <pg.php@radax.net>
2004-01-19 08:27 ` Enrico Ortmann <pg.php@radax.net>
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