Re:Things that don’t work well with MySQL’s FOREIGN KEY impl...
by ComputerGuru on Monday May 01, 2023 @11:48AM
(#35774523)
The last time I checked, MySQL still can’t do foreign keys with binary blobs. (I think it works with some very specific limitations but not enough to actually use in the real world.)
[ Parent
| on HN ]
Re:Things that don’t work well with MySQL’s FOREIGN KEY impl...
by AugustoCAS on Monday May 01, 2023 @03:08PM
(#35777594)
I have the strong feeling I would never do this regardless of the DB engine for performance and storage reasons. I would try to hash the blob into a bigint and use that as the PK/FK.
Out of curiosity, is there a scenario you can share in which using a binary blob as a PK/FK would be the best solution?
Re:Things that don’t work well with MySQL’s FOREIGN KEY impl...
by ComputerGuru on Monday May 01, 2023 @04:57PM
(#35779037)
I'm not talking huge blobs, just (fixed-size) 8- to 16-byte uuid-like fields. You can obviously marshal 8-byte fields to a bigint but you can't do that with 16-byte fields.