|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #25854 Return value for pg_insert should be resource instead of bool
Submitted: 2003-10-13 14:29 UTC Modified: 2014-02-16 22:03 UTC
Avg. Score:4.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: kyle at kipr dot org Assigned: yohgaki (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 4.3.3 OS: RH9.0 Linux
Private report: No CVE-ID: None
 [2003-10-13 14:29 UTC] kyle at kipr dot org
Currently, pg_insert() returns a bool rather than a resource. Usually, insert queries return resources which can be passed to pg_last_oid() for pulling the OID of that insert statement's created row. However, nothing can really be done with the "true" return value given by pg_insert(), therefore making it not quite as useful a function as it could be.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 21:09 UTC]
-Package: Feature/Change Request +Package: PostgreSQL related
 [2012-03-31 05:25 UTC]
OID was always available for old PostgreSQL, but OID can be omitted. 

It's possible to return OID when it's available otherwise return true.
 [2012-03-31 05:25 UTC]
-Assigned To: +Assigned To: yohgaki
 [2012-04-17 10:30 UTC]
-Status: Assigned +Status: Wont fix
 [2012-04-17 10:30 UTC]
I think twice if returning oid is good.
It may be useful for some applications, but it may not for recent usages. Recent 
postgresql apps omits OID often.

Therefore, I'll not change this behavior.
 [2012-04-17 10:48 UTC]
-Status: Wont fix +Status: Assigned
 [2012-04-17 10:48 UTC]
Returning resource makes sense. Assigned again.
 [2014-02-16 22:03 UTC]
-Status: Assigned +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Feb 27 08:01:29 2024 UTC