diff options
| -rw-r--r-- | datadict/datadict-postgres.inc.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/datadict/datadict-postgres.inc.php b/datadict/datadict-postgres.inc.php index 0839a331..97b3f675 100644 --- a/datadict/datadict-postgres.inc.php +++ b/datadict/datadict-postgres.inc.php @@ -231,6 +231,10 @@ class ADODB2_postgres extends ADODB_DataDict $existing = $this->metaColumns($tabname); list(,$colname,$default) = $matches; $alter .= $colname; + + $v = preg_replace('/^' . preg_quote($colname) . '\s/', '', $v); + $t = trim(str_replace('DEFAULT '.$default,'',$v)); + if ($this->connection) { if (array_key_exists(strtoupper($colname), $existing)) { $old_coltype = $this->connection->metaType($existing[strtoupper($colname)]); @@ -240,9 +244,6 @@ class ADODB2_postgres extends ADODB_DataDict } else { $old_coltype = $t; } - $v = preg_replace('/^' . preg_quote($colname) . '\s/', '', $v); - $t = trim(str_replace('DEFAULT '.$default,'',$v)); - // Type change from bool to int if ( $old_coltype == 'L' && $t == 'INTEGER' ) { $sql[] = $alter . ' DROP DEFAULT'; |
