* Fix Find for domain constraints
* Fix popup SQL window so that two different phpPgAdmin instances should
not want to use the same pop-up.
+* Fix create table if you don't supply as many fields as you originally
+ specified.
Translations
* Trad. Chinese from Chih-Hsin Lee
* A class that implements the DB interface for Postgres
* Note: This class uses ADODB and returns RecordSets.
*
- * $Id: Postgres.php,v 1.218 2004/05/28 08:17:22 chriskl Exp $
+ * $Id: Postgres.php,v 1.219 2004/06/03 03:48:22 chriskl Exp $
*/
// @@@ THOUGHT: What about inherits? ie. use of ONLY???
if ($status != 0) return -1;
$found = false;
+ $first = true;
$comment_sql = ''; //Accumulate comments for the columns
$sql = "CREATE TABLE \"{$name}\" (";
for ($i = 0; $i < $fields; $i++) {
// Skip blank columns - for user convenience
if ($field[$i] == '' || $type[$i] == '') continue;
+ // If not the first column, add a comma
+ if (!$first) $sql .= ", ";
+ else $first = false;
switch ($type[$i]) {
// Have to account for weird placing of length for with/without
// Add other qualifiers
if (isset($notnull[$i])) $sql .= " NOT NULL";
if ($default[$i] != '') $sql .= " DEFAULT {$default[$i]}";
- if ($i != $fields - 1) $sql .= ", ";
if ($colcomment[$i] != '') $comment_sql .= "COMMENT ON COLUMN \"{$name}\".\"{$field[$i]}\" IS '{$colcomment[$i]}';\n";