php.net |  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
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
Status: Closed Package: PostgreSQL related
PHP Version: 4.3.3 OS: RH9.0 Linux
Private report: No CVE-ID:
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-03-31 05:25 UTC] yohgaki@php.net
-Assigned To: +Assigned To: yohgaki
 [2012-04-17 10:30 UTC] yohgaki@php.net
-Status: Assigned +Status: Wont fix
 [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
-Status: Wont fix +Status: Assigned
 [2012-04-17 10:48 UTC] yohgaki@php.net
Returning resource makes sense. Assigned again.
 [2014-02-16 22:03 UTC] yohgaki@php.net
-Status: Assigned +Status: Closed
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Thu Feb 23 02:01:35 2017 UTC