| От | Bruno Wolff III |
|---|---|
| Тема | Re: primary key and existing unique fields |
| Дата | |
| Msg-id | 20041027135534.GC3160@wolff.to обсуждение исходный текст |
| Ответ на | Re: primary key and existing unique fields (Dawid Kuroczko <qnex42@gmail.com>) |
| Список | pgsql-general |
On Wed, Oct 27, 2004 at 00:10:27 +0200, Dawid Kuroczko <qnex42@gmail.com> wrote: > 3. If you'll need things like "last 50 keys", you can SELECT * FROM > foo ORDER BY yourserialkey DESC LIMIT 50; You really shouldn't be doing that if you are using sequences to generate the key. Sequences are just guarenteed to return unique values, not to return them in order. Because groups of sequences can be allocated to a backend at once depending on a setting settable by a client, you can get assignments out of order. Also for overlapping transactions what the application means by the last 50 entries may not match what you get when you get the 50 highest serial values.
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера