Re: BUG #3811: Getting multiple values from a sequence generator
От | Gregory Stark |
---|---|
Тема | Re: BUG #3811: Getting multiple values from a sequence generator |
Дата | |
Msg-id | 87wsrnmjyi.fsf@oxford.xeocode.com обсуждение исходный текст |
Ответ на | Re: BUG #3811: Getting multiple values from a sequence generator (Michael Glaesemann <grzm@seespotcode.net>) |
Список | pgsql-bugs |
"Michael Glaesemann" <grzm@seespotcode.net> writes: > On Dec 9, 2007, at 9:24 , Adriaan van Os wrote: > >> 3. nextval doesn't have an optional "increase" parameter (the increase is >> always one). > > Not true. Please read the documentation at > > http://www.postgresql.org/docs/8.2/static/sql-createsequence.html > http://www.postgresql.org/docs/8.2/static/sql-altersequence.html > > In particular, the INCREMENT BY option (and perhaps CACHE). I think he's looking for a an option to increase a sequence which normally increments by 1 by a larger number for a single transaction. You would want to do this if you were doing an exceptional bulk operation. If you set the "increment by" then if another transaction happens to come along while you've modified it you'll waste N sequence numbers. Seems like a reasonable feature request. But I do wonder if the OP has actually tried just incrementing it one by one for each of the records being inserted. Incrementing sequences is pretty damn quick and I doubt it would actually be a bottleneck. -- Gregory Stark EnterpriseDB http://www.enterprisedb.com Ask me about EnterpriseDB's PostGIS support!
В списке pgsql-bugs по дате отправления: