do create_database the usual way and don't read the data of a whole table to get just the layout

This commit is contained in:
Carsten Wolff 2003-11-07 17:32:32 +00:00
parent 369b9ede5e
commit 5f95db7595

View File

@ -354,7 +354,7 @@
$res = array();
$this->connect();
$id = pg_exec($this->Link_ID, "select * from $table");
$id = pg_exec($this->Link_ID, "select * from $table where false");
if ($id < 0)
{
$this->Error = pg_ErrorMessage($id);
@ -515,18 +515,13 @@
{
$this->User = $adminname;
$this->Password = $adminpasswd;
$this->Database = "template1";
}
$this->disconnect();
$outval = $this->query("CREATE DATABASE $currentDatabase;");
$this->disconnect();
if (! $this->Host)
{
system('createdb ' . $currentDatabase, $outval);
}
else
{
system('createdb -h ' . $this->Host . ' ' . $currentDatabase, $outval);
}
if($outval != 0)
if(!$outval)
{
/* either the rights r not available or the postmaster is not running .... */
echo 'database creation failure <BR>';
@ -537,7 +532,6 @@
$this->Password = $currentPassword;
$this->Database = $currentDatabase;
$this->connect();
//return $return;
}
}