I am looking for a Drupal database neutral alternative to mysql_insert_id that has good performance. I looked at db_next_id but on MySQL it involves four queries and a database lock/unlock.

There were various discussions in these forums about alternatives in particular:

http://drupal.org/node/55516

But the patch proposed by chx seems to be on hold till Drupal 5 comes out.

I suppose I could code up something for my particular module for postgresql using the notes here:

http://www.postgresql.org/docs/faqs.FAQ.html#item4.11.1

but that seems a poor alternative.

I'm just hoping there is some solution I've missed.

Lee

Comments