Re:UUID, serial or identity columns for PostgreSQL auto-gene...
by ccleve on Monday May 31, 2021 @10:03PM
(#27350047)
The Postgres JDBC driver does not guarantee that batch inserts come back in the same order that you insert them (when you use RETURNING *). So, if you generate UUIDs server-side, you can't conveniently match them up with the records you just inserted. You're better off generating them in the app server first and then sending them to Postgres.
[ Parent
| on HN ]
Re:UUID, serial or identity columns for PostgreSQL auto-gene...
by ccleve on Monday May 31, 2021 @10:15PM
(#27350102)
Plus, it's way better to generate a UUID in the app server and send it to the server as a string. The reason is that you can deal with the id as a plain string and don't have to deal with a non-standard datatype in your app.