Req #25854 [Asn->Csd]: Return value for pg_insert should be resource instead of bool

From: Date: Sun, 16 Feb 2014 22:03:20 +0000
Subject: Req #25854 [Asn->Csd]: Return value for pg_insert should be resource instead of bool
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-184329@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=25854&edit=1

 ID:                 25854
 Updated by:         yohgaki@php.net
 Reported by:        kyle at kipr dot org
 Summary:            Return value for pg_insert should be resource
                     instead of bool
-Status:             Assigned
+Status:             Closed
 Type:               Feature/Change Request
 Package:            PostgreSQL related
 Operating System:   RH9.0 Linux
 PHP Version:        4.3.3
 Assigned To:        yohgaki
 Block user comment: N
 Private report:     N

 New Comment:

http://git.php.net/?p=php-src.git;a=commitdiff;h=d8aa13029675c6651243f144c328411c9f9c38d5

Implemented.


Previous Comments:
------------------------------------------------------------------------
[2012-04-17 10:48:38] yohgaki@php.net

Returning resource makes sense. Assigned again.

------------------------------------------------------------------------
[2012-04-17 10:30:27] 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-03-31 05:25:16] 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.

------------------------------------------------------------------------
[2003-10-13 14:29:41] 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.



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=25854&edit=1


Thread (5 messages)

« previous php.bugs (#184329) next »