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

Submitted by:  Sigurd Nes <sigurdne>
Submitted on:  Tue 31 Jan 2006 10:06:38 AM UTC  
 
Item Group: 0.9.16.010Category: API - phpGroupware API
Severity: 4 - ImportantPriority: 5 - Normal
Status: FixedPrivacy: Public
Assigned to: Dave Hall <skwashd>Open/Closed: Closed
Component Version: NoneOperating System: None
Reproducibility: NonePlanned Release: None
Fixed Release: 

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.postgresql.org/docs/8.1/interactive/functions-sequence.html

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

Works fine for me.

Sigurd

Sigurd Nes <sigurdne>
Project 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>
Project Member

 

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)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 21 Mar 2006 05:54:50 PM UTCsigurdneStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Wed 01 Feb 2006 12:21:35 PM UTCsigurdneAttached File#3346=>Removed
Wed 01 Feb 2006 12:20:40 PM UTCsigurdneAttached File-=>Added patch_pgsql_8x.diff, #3353
Tue 31 Jan 2006 10:29:47 AM UTCsigurdneAttached File-=>Added patch_pgsql_8x.diff, #3346

Back to the top


Powered by Savane 3.1-cleanup1