fix for bug #488: Postgres errors when upgrading to 1.4 beta

This commit is contained in:
Ralf Becker
2007-05-12 16:58:47 +00:00
parent 32864e955a
commit 7f64e2d175
3 changed files with 68 additions and 26 deletions

View File

@ -165,7 +165,7 @@ a different OID if a database must be reloaded. */
$cols = $this->MetaColumns($table);
$fld = $cols[strtoupper($column)];
if ($fld->primary_key && $fld->has_default &&
preg_match("/nextval\('([^']+)'::text\)/",$fld->default_value,$matches)) {
preg_match("/nextval\('([^']+)'::(text|regclass)\)/",$fld->default_value,$matches)) {
$ret = $this->GetOne($sql='SELECT currval('.$this->qstr($matches[1]).')');
}
}