diff options
| author | Mark Newnham <mark@newnhams.com> | 2026-02-09 15:55:41 -0700 |
|---|---|---|
| committer | Mark Newnham <mark@newnhams.com> | 2026-02-09 15:55:41 -0700 |
| commit | f67b2273187925d5b84a4747bc91c2f32d9e8444 (patch) | |
| tree | 737b375afa5617c640d50744ca8d3e5d38a235fb /datadict/datadict-postgres.inc.php | |
| parent | d86521c62332cf3165326c4814c8726286fe27d1 (diff) | |
| download | adodb-f67b2273187925d5b84a4747bc91c2f32d9e8444.tar.gz adodb-f67b2273187925d5b84a4747bc91c2f32d9e8444.tar.bz2 adodb-f67b2273187925d5b84a4747bc91c2f32d9e8444.zip | |
Obtains values of $v and $t before use
Diffstat (limited to 'datadict/datadict-postgres.inc.php')
| -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'; |
