| От | Peter Eisentraut |
|---|---|
| Тема | sequence data type |
| Дата | |
| Msg-id | 898deb94-5265-37cf-f199-4f79ef864536@2ndquadrant.com обсуждение |
| Ответы |
Re: sequence data type
Re: [HACKERS] sequence data type |
| Список | pgsql-hackers |
Here is a patch that adds the notion of a data type to a sequence. So
it might be CREATE SEQUENCE foo AS integer. The types are restricted to
int{2,4,8} as now.
The main point of this is to make monitoring sequences less complicated.
Right now, a serial column creates an int4 column but creates the
sequence with a max value for int8. So in order to correctly answer the
question, is the sequence about to run out, you need to look not only at
the sequence but also any columns it is associated with. check_postgres
figures this out, but it's complicated and slow, and not easy to do
manually.
If you tell the sequence the data type you have in mind, it
automatically sets appropriate min and max values. Serial columns also
make use of this, so the sequence type automatically matches the column
type.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера