Re: WIP: generalized index constraints

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Brendan Jurd <direvus(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: WIP: generalized index constraints
Date: 2009-09-15 19:18:46
Message-ID: 1253042326.29243.52.camel@monkey-cat.sm.truviso.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 2009-09-15 at 14:49 -0400, Tom Lane wrote:
> Does it behave sanely for operators that are non-commutative, such
> as '>'? (I'm not even very sure that I know what "sanely" would be
> in such a case.)

One of the requirements is commutativity (I called it "symmetry" in the
docs, for some reason, I will change that).

I haven't explored in too much detail, but using "x >" (or maybe its
"<" ?) would basically mean that you can only insert increasing values
of x. There most likely be some serious problems there, for instance, if
you HOT update an old tuple's "y" attribute, everything is fine; if you
cold update it you would get an error.

Not exactly intuitive, but if you have lots of other requirements about
how things are updated, then I suppose it might be useful to someone.

If you try it, my current patch won't stop you. Maybe I should detect
the fact that the commutator of an operator is not the operator itself,
and throw an ERROR? Probably would be a good idea.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2009-09-15 19:22:46 Re: WIP: generalized index constraints
Previous Message Kevin Grittner 2009-09-15 19:06:07 Re: Timestamp to time_t