Skip site navigation (1) Skip section navigation (2)

Operators and commutation

From: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hackers List <pgsql-hackers(at)postgresql(dot)org>
Subject: Operators and commutation
Date: 2000-12-01 07:19:02
Message-ID: 3A2750E6.C5751C3E@alumni.caltech.edu (view raw or flat)
Thread:
Lists: pgsql-hackers
Tom, can you refresh my memory on the preferred way to define
"commutative operators" for operators with mixed input types? For
example, I want to define a new operator to add an interval to a time.
Do I need to fully implement the commutative function which adds a time
to an interval, or is there another way?

I used to have a cheat interpretation of commutation during operator
matching in the parser (which allowed a mixed-type operator to refer to
itself as its commutator, and the parser would then flip the arguments
around to match up), but I recall that you took this out to reinforce
the purity of the interpretation of commutation in the table flags. So
what is the best way to do this now?

                         - Thomas

Responses

pgsql-hackers by date

Next:From: Nathan MyersDate: 2000-12-01 07:30:32
Subject: Re: beta testing version
Previous:From: Tom LaneDate: 2000-12-01 07:16:39
Subject: Re: Operators and commutation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group