From: Vladimir G. <vla...@du...> - 2010-04-15 16:56:29
|
On Apr 15, 2010, at 12:04 PM, William Piel wrote: > 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. There is. But to make that work reliably with your script we'll need first shut everybody out of the database and check that the PKids did not yet run past the ones that your script assigns. If you can truly say this is the first and last request of this kind, we can do it today, Hilmar-permitting ;-) >> 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. Wouldn't the lookup of newly assigned PKs via their ubio IDs that I suggested work? If ubio IDs are not unique enough, then what Hilmar has mentioned may work... > (So... yet another advantage of Navicat is that I get to see the > autogenerated id right away for use in subsequent edits). Agreed, provided we can ensure that Navicat cannot modify the PK fields directly (I'd guess, Postres has field-level access control, but I am not sure.) --VG |