Handling the lack of INSERT IGNORE and REPLACE in non-MySQL databases

Robin H. Johnson robbat2 at gentoo.org
Tue Jun 12 23:00:48 UTC 2007


While working on the Postgres store, I've been annoyed by Postgres's
lack of INSERT IGNORE/REPLACE, as a lot of the Mogile code makes sane
use of them (I have a MySQL background ;-).

I condensed all the information I could find into a post here:
http://robbat2.livejournal.com/214267.html

There is a further option for Mogile, and that's overriding the INSERT
IGNORE/REPLACE queries for every database that can't handle them, which
frankly sucks I think.

Mogile already has it's own insert_ignore hack, but you need to be very
careful using that for multi-row inserts. It fails badly there as I
found out the hard way - the testcases did pass with my previous patch,
but there was subtle breakage and things not working right that I didn't
check properly for (Like the 'INSERT IGNORE' statement over in
server/lib/MogileFS/Worker/Delete.pm).

-- 
Robin Hugh Johnson
Gentoo Linux Developer & Council Member
E-Mail     : robbat2 at gentoo.org
GnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 321 bytes
Desc: not available
Url : http://lists.danga.com/pipermail/mogilefs/attachments/20070612/ae12f280/attachment.pgp


More information about the mogilefs mailing list