Skip to content

Use same drop setup on install and uninstall #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions sql/000-ore.sql
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $$ LANGUAGE plpgsql;
-- doesn't always make sense but it's here for completeness.
-- If both are non-empty, we compare the first element. If they are equal
-- we need to consider the next block so we recurse, otherwise we return the comparison result.

DROP FUNCTION IF EXISTS compare_ore_array(a ore_64_8_index_v1, b ore_64_8_index_v1);

CREATE FUNCTION compare_ore_array(a ore_64_8_index_v1, b ore_64_8_index_v1)
RETURNS integer AS $$
Expand Down Expand Up @@ -184,8 +184,8 @@ DROP OPERATOR IF EXISTS = (ore_64_8_index_v1, ore_64_8_index_v1);

CREATE OPERATOR = (
PROCEDURE="ore_64_8_v1_eq",
LEFTARG=ore_64_8_v1,
RIGHTARG=ore_64_8_v1,
LEFTARG=ore_64_8_index_v1,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The drop failure was hiding that the type name had changed

RIGHTARG=ore_64_8_index_v1,
NEGATOR = <>,
RESTRICT = eqsel,
JOIN = eqjoinsel,
Expand All @@ -198,8 +198,8 @@ DROP OPERATOR IF EXISTS <> (ore_64_8_index_v1, ore_64_8_index_v1);

CREATE OPERATOR <> (
PROCEDURE="ore_64_8_v1_neq",
LEFTARG=ore_64_8_v1,
RIGHTARG=ore_64_8_v1,
LEFTARG=ore_64_8_index_v1,
RIGHTARG=ore_64_8_index_v1,
NEGATOR = =,
RESTRICT = eqsel,
JOIN = eqjoinsel,
Expand All @@ -211,8 +211,8 @@ DROP OPERATOR IF EXISTS > (ore_64_8_index_v1, ore_64_8_index_v1);

CREATE OPERATOR > (
PROCEDURE="ore_64_8_v1_gt",
LEFTARG=ore_64_8_v1,
RIGHTARG=ore_64_8_v1,
LEFTARG=ore_64_8_index_v1,
RIGHTARG=ore_64_8_index_v1,
COMMUTATOR = <,
NEGATOR = <=,
RESTRICT = scalargtsel,
Expand All @@ -224,8 +224,8 @@ DROP OPERATOR IF EXISTS < (ore_64_8_index_v1, ore_64_8_index_v1);

CREATE OPERATOR < (
PROCEDURE="ore_64_8_v1_lt",
LEFTARG=ore_64_8_v1,
RIGHTARG=ore_64_8_v1,
LEFTARG=ore_64_8_index_v1,
RIGHTARG=ore_64_8_index_v1,
COMMUTATOR = >,
NEGATOR = >=,
RESTRICT = scalarltsel,
Expand All @@ -237,8 +237,8 @@ DROP OPERATOR IF EXISTS <= (ore_64_8_index_v1, ore_64_8_index_v1);

CREATE OPERATOR <= (
PROCEDURE="ore_64_8_v1_lte",
LEFTARG=ore_64_8_v1,
RIGHTARG=ore_64_8_v1,
LEFTARG=ore_64_8_index_v1,
RIGHTARG=ore_64_8_index_v1,
COMMUTATOR = >=,
NEGATOR = >,
RESTRICT = scalarlesel,
Expand All @@ -250,8 +250,8 @@ DROP OPERATOR IF EXISTS >= (ore_64_8_index_v1, ore_64_8_index_v1);

CREATE OPERATOR >= (
PROCEDURE="ore_64_8_v1_gte",
LEFTARG=ore_64_8_v1,
RIGHTARG=ore_64_8_v1,
LEFTARG=ore_64_8_index_v1,
RIGHTARG=ore_64_8_index_v1,
COMMUTATOR = <=,
NEGATOR = <,
RESTRICT = scalarlesel,
Expand All @@ -266,7 +266,7 @@ CREATE OPERATOR FAMILY ore_64_8_v1_btree_ops USING btree;

DROP OPERATOR CLASS IF EXISTS ore_64_8_v1_btree_ops USING btree;

CREATE OPERATOR CLASS ore_64_8_v1_btree_ops DEFAULT FOR TYPE ore_64_8_v1 USING btree FAMILY ore_64_8_v1_btree_ops AS
CREATE OPERATOR CLASS ore_64_8_v1_btree_ops DEFAULT FOR TYPE ore_64_8_index_v1 USING btree FAMILY ore_64_8_v1_btree_ops AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
Expand Down
4 changes: 2 additions & 2 deletions sql/666-drop-operators.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DROP OPERATOR FAMILY IF EXISTS cs_encrypted_ore_64_8_v1_btree_ops_v1 USING btree;
DROP OPERATOR CLASS IF EXISTS cs_encrypted_ore_64_8_v1_btree_ops_v1 USING btree;
DROP OPERATOR FAMILY IF EXISTS cs_encrypted_ore_64_8_v1_btree_ops_v1 USING btree CASCADE;
DROP OPERATOR CLASS IF EXISTS cs_encrypted_ore_64_8_v1_btree_ops_v1 USING btree CASCADE;

DROP OPERATOR IF EXISTS @> (cs_encrypted_v1, cs_encrypted_v1);
DROP OPERATOR IF EXISTS @> (cs_encrypted_v1, cs_match_index_v1);
Expand Down
2 changes: 1 addition & 1 deletion sql/666-drop_types.sql → sql/666-drop-types.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- ANYTHING THAT NEEDS TO BE DROPPED LAST
DROP TYPE IF EXISTS ore_64_8_v1;
DROP TYPE IF EXISTS ore_64_8_index_v1;
DROP TYPE IF EXISTS cs_ste_vec_index_v1;
DROP TYPE IF EXISTS cs_ste_vec_v1_entry;
DROP TYPE IF EXISTS ore_cllw_8_v1;
Expand Down
Loading