| От | Tom Lane |
|---|---|
| Тема | Re: Guarenteeing ordering constraints |
| Дата | |
| Msg-id | 5772.1172160974@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Guarenteeing ordering constraints ("Joris Dobbelsteen" <Joris@familiedobbelsteen.nl>) |
| Список | pgsql-general |
"Joris Dobbelsteen" <Joris@familiedobbelsteen.nl> writes:
> I have some trouble guarenteeing that an ordering constraint is enforced
> on the database. On the table ordering (see below) I want to enforce
> that for every tuple t, all tuples u where u.position < t.position this
> implies u.cumvalue <= t.cumvalue.
I can't think of any reasonable way to enforce that in SQL. Perhaps you
should consider restructuring your tables in such a way that this
behavior emerges from a constraint that is enforceable --- maybe the
cumulative values should be a (materialized?) view on an underlying
table that contains individual observations.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера