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 (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 4.3.3 OS: RH9.0 Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kyle at kipr dot org
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 04:01:27 2024 UTC