From: William P. <wil...@ya...> - 2010-04-15 16:04:46
|
On Apr 15, 2010, at 10:26 AM, Vladimir Gapeyev wrote: > As you anticipated, inserting new PKs will confuse Hibernate, since the PKs the update creates are higher than > the current values in the sequences that generate the PKs under normal > operation. The latter will catch up and clash eventually. So you're saying that there is nothing equivalent to: SELECT pg_catalog.setval('taxa_taxa_id_seq', 80500, true); ... to tell Hibernate's sequencing system to reset to a higher value? There is no way to reset Hibernate's autoincrement value to a next higher one? I'm kind of surprised by that. > Can you modify the script that the INSERT statements do not specify > the PK values? Absolutely -- however in some cases we use the new ID as FK for another insert or update. So those cases would have be be filtered out, and perhaps put in a perl script where "get last id" can be stored in a scalar for use in subsequent statements. (So... yet another advantage of Navicat is that I get to see the autogenerated id right away for use in subsequent edits). your thoughts? bp |