|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37459 pg_convert fails with bigint
Submitted: 2006-05-16 10:07 UTC Modified: 2006-05-16 13:06 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: peterh at criten dot org Assigned:
Status: Not a bug Package: PostgreSQL related
PHP Version: 5.1.4 OS: FreeBSD 5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: peterh at criten dot org
New email:
PHP Version: OS:


 [2006-05-16 10:07 UTC] peterh at criten dot org
I noticed when I send pg_convert a large integer intended for a bigint column, it returns an incorrect (and negative) value.

Reproduce code:
$data['size'] = 33971734946;
$result = pg_convert($database,$table,$data);


Expected result:
Array ( [size] => 33971734946 )

Actual result:
Array ( [size] => -388003422 )


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-16 13:06 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Integers on 32 bit systems in PHP are limited to 2.14 billion. 
To avoid the limitation make the assignment operation use 
strings like this:

$data['size'] = '33971734946';
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 14:01:31 2024 UTC