Skip to content

Commit 3127b88

Browse files
committed
Change to_number function to CAST AS in PostgreSQL Builder
1 parent b4d49c6 commit 3127b88

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

system/Database/Postgre/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function incrementMany(array $columns, int $value = 1): bool
115115
}
116116

117117
$col = $this->db->protectIdentifiers($col);
118-
$fields[$col] = "to_number({$col}, '9999999') + {$val}";
118+
$fields[$col] = "CAST({$col} AS numeric) + {$val}";
119119
}
120120

121121
$sql = $this->_update($this->QBFrom[0], $fields);
@@ -157,7 +157,7 @@ public function decrementMany(array $columns, int $value = 1): bool
157157
}
158158

159159
$col = $this->db->protectIdentifiers($col);
160-
$fields[$col] = "to_number({$col}, '9999999') - {$val}";
160+
$fields[$col] = "CAST({$col} AS numeric) - {$val}";
161161
}
162162

163163
$sql = $this->_update($this->QBFrom[0], $fields);

0 commit comments

Comments
 (0)