bugphpGroupWare - Bugs: bug #15588, get_last_insert_id broken for...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #15588: get_last_insert_id broken for PostgreSQL 8.x

Submitter:  Sigurd Nes <sigurdne>
Submitted:  Tue 31 Jan 2006 10:06:38 AM UTC
   
 
Category:  API - phpGroupware API Item Group:  0.9.16.010
Severity:  4 - Important Priority:  5 - Normal
Status:  Fixed Privacy:  Public
Assigned to:  skwashd Open/Closed:  Closed
Component Version:  None Operating System:  None
Reproducibility:  None Planned Release:  None
Fixed Release: 

Discussion

Wed 01 Feb 2006 12:20:40 PM UTC, comment #2: 

This one checks the version - and if it is pre 8.1 - it uses the oid-method - otherwise it use the lastval() function.
I still think the inserts should be protected inside transactions.
manual:
http://www.postgr ... ons-sequence.html

Sigurd Nes <sigurdne>
Group Member
Tue 31 Jan 2006 10:29:47 AM UTC, comment #1: 

Works fine for me.

Sigurd

Sigurd Nes <sigurdne>
Group Member
Tue 31 Jan 2006 10:06:38 AM UTC, original submission:  

The OID field is not be present by default in PostgreSQL 8.1 and therefore the get_last_insert_id in class.db_pgsql.inc.php that relays on pg_last_oid() won't work.
There is a mention of a function lastval() to retrieve the last inserted sequence - but I think this is a new function. One might have to check for the pgsql version - and then apply the appropiate method.

Or - it might be sufficient to ask for the max value of the field in question?

Anyone care to fix this?

Regards

Sigurd

Sigurd Nes <sigurdne>
Group Member

 

Attached Files

Attached Files
file #2064:  patch_pgsql_8x.diff added by sigurdne (735B - application/octet-stream - get_last_insert_id() : check for version - lastval() for 8.1 and later)

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

 

Votes

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

History

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-03-21 sigurdne StatusNone Fixed
    Open/ClosedOpen Closed
2006-02-01 sigurdne Attached File#3346 Removed
2006-02-01 sigurdne Attached File- Added patch_pgsql_8x.diff, #3353
2006-01-31 sigurdne Attached File- Added patch_pgsql_8x.diff, #3346

Back to the top

Powered by Savane 3.16-a7ba.
Corresponding source code