Tom Lane writes:

> Here's what I'm thinking of: specify that the "input" datatype of an
> operator class (pg_opclass.opcintype) is actually just the type of the
> indexed column.  Operators that are members of the opclass must take this
> type as their left-hand input, but the right-hand input can be some other
> type.  pg_amop gets an additional column that is the right-hand data type
> of the operator, and its primary key becomes (opclass, righthandtype,
> strategy) rather than just (opclass, strategy).

Yes, that looks to be the right way.

> One way in which we will lose some flexibility is that this design nails
> down forevermore the assumption that the indexed column is on the lefthand
> side of any indexable clause.

I don't see this as a problem, but if it becomes one we can relabel "left
operand" as "indexed operand" and "right operand" as "variable operand",
and add a boolean flag telling which is right and left.

-- 
Peter Eisentraut   [EMAIL PROTECTED]


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to