Skip to content
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

Allow postgres role to create operator class and create operator family #72

Open
olirice opened this issue Jan 18, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@olirice
Copy link
Collaborator

olirice commented Jan 18, 2024

Feature request

A user is requesting the ability to create operator class and create operator family so they can bring a bit of a DSL-y experience to their project complete with custom operators that can leverage indexes.

Repro case

CREATE OR REPLACE FUNCTION integer_compare(a integer, b integer) RETURNS boolean AS $$
BEGIN
    RETURN a > b;
END;
$$ LANGUAGE plpgsql;

CREATE OPERATOR @@ (
    LEFTARG = integer,
    RIGHTARG = integer,
    PROCEDURE = integer_compare,
    RETURNS = boolean
);


CREATE OPERATOR FAMILY integer_family USING btree;


CREATE OPERATOR CLASS integer_ops FOR TYPE integer USING btree FAMILY integer_family AS
    OPERATOR 1 @@ (integer, integer);

Currently this will fail on

CREATE OPERATOR FAMILY integer_family USING btree;

with

ERROR:  42501: must be superuser to create an operator family

The existing postgres permissions system does not have a dedicated role for these capabilities.

This task is to evaluate

  • if it is possible to enable creating operator families and operator classes using the postgres role
  • If possible, how much work would it be

Given how niche the request is, unless it only requires an extremely straightforward and safe change we should not implement this feature.

@olirice olirice added the bug Something isn't working label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants