mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-21 10:27:52 +02:00
postgres fix (error in converting varchar to int if >= 100)
This commit is contained in:
parent
920af8e10e
commit
3b2da86ce2
@ -214,7 +214,7 @@ class ADODB2_postgres extends ADODB_DataDict {
|
|||||||
// we need to explicit convert varchar to a number to be able to do an AlterColumn of a char column to a nummeric one
|
// we need to explicit convert varchar to a number to be able to do an AlterColumn of a char column to a nummeric one
|
||||||
if (preg_match('/'.$fld->name.' (I|I2|I4|I8|N|F)/i',$tableflds,$matches) &&
|
if (preg_match('/'.$fld->name.' (I|I2|I4|I8|N|F)/i',$tableflds,$matches) &&
|
||||||
in_array($fld->type,array('varchar','char','text','bytea'))) {
|
in_array($fld->type,array('varchar','char','text','bytea'))) {
|
||||||
$copyflds[] = "to_number($fld->name,'S99D99')";
|
$copyflds[] = "to_number($fld->name,'S9999999999999D99')";
|
||||||
} else {
|
} else {
|
||||||
$copyflds[] = $fld->name;
|
$copyflds[] = $fld->name;
|
||||||
}
|
}
|
||||||
|
@ -438,7 +438,7 @@
|
|||||||
in_array($old_table_def['fd'][$name]['type'],array('char','varchar','text','blob')) &&
|
in_array($old_table_def['fd'][$name]['type'],array('char','varchar','text','blob')) &&
|
||||||
in_array($data['type'],array('int','decimal')))
|
in_array($data['type'],array('int','decimal')))
|
||||||
{
|
{
|
||||||
$value = "to_number($name,'S99D99')";
|
$value = "to_number($name,'S9999999999999D99')";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // new column => use default value or NULL
|
else // new column => use default value or NULL
|
||||||
|
Loading…
x
Reference in New Issue
Block a user