Re: Guarenteeing ordering constraints

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: Lincoln Yeoh
Дата:
Сообщение: Re: postgresql vs mysql
Следующее
От: Tim Tassonis
Дата:
Сообщение: Re: php professional