Skip to content

Commit

Permalink
chore(electric): Remove the operator class for the electric.tag type (
Browse files Browse the repository at this point in the history
#656)

Only a superuser can create an operator class but we're moving away from
the superuser requirement for Electric.

An operator class is used in the following situations:

* an index is created on a column that has a user-defined type with
custom operators defined for it

  * values of the user-defined type appear in the ORDER BY clause

* values of the user-defined type are used in DISTINCT or GROUP BY
clauses

I haven't been able to conduct an exhaustive audit of the code to
confirm that we don't use the electric.tag type in those contexts. So
I'm proposing we merge this change into main and see if that causes any
issues in how Electric works.
  • Loading branch information
alco authored Nov 13, 2023
1 parent 0673596 commit c1ceefc
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,3 @@ CREATE OR REPLACE FUNCTION electric.tag_operator_cmp(first electric.tag, second
WHEN first < second then -1
ELSE 1
END;


CREATE OPERATOR CLASS btree__electric_tag_ops
DEFAULT FOR TYPE electric.tag USING btree AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
OPERATOR 4 >=,
OPERATOR 5 >,
FUNCTION 1 electric.tag_operator_cmp(electric.tag, electric.tag);

0 comments on commit c1ceefc

Please sign in to comment.