Re: Guarenteeing ordering constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joris Dobbelsteen" <Joris(at)familiedobbelsteen(dot)nl>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Guarenteeing ordering constraints
Date: 2007-02-22 16:16:14
Message-ID: 5772.1172160974@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Joris Dobbelsteen" <Joris(at)familiedobbelsteen(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Tassonis 2007-02-22 16:19:10 Re: php professional
Previous Message Lincoln Yeoh 2007-02-22 16:12:16 Re: postgresql vs mysql