Return value for pg_insert should be resource instead of bool

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
Votes:2
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

Description:
------------
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.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2011-01-01 21:09 UTC] jani@php.net

-Package: Feature/Change Request +Package: PostgreSQL related

 [2012-03-31 05:25 UTC] yohgaki@php.net

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-04-17 10:30 UTC] yohgaki@php.net

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] yohgaki@php.net

Returning resource makes sense. Assigned again.