Re: BUG #17883: Segmentation fault when create brin index on user-defined type. - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17883: Segmentation fault when create brin index on user-defined type.
Date
Msg-id 1372026.1680611902@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17883: Segmentation fault when create brin index on user-defined type.  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> CREATE OPERATOR CLASS sva_special_ops
> FOR TYPE text using brin
> AS
>     OPERATOR 1 <#,
>     OPERATOR 2 <=#,
>     OPERATOR 3 >=#,
>     OPERATOR 4 >#,
> function 1 si_same(text,text);

This is certainly not a valid BRIN operator class definition.
There are four required support functions, not just one, and
I seriously doubt that any of them can usefully be written in
plpgsql.  (You also got the set of operators wrong, but that's
not the issue here.)  See

https://www.postgresql.org/docs/current/brin-extensibility.html

And yes, invalid operator class definitions can crash the system.
That's why you can't create one unless you're superuser.

            regards, tom lane



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17883: Segmentation fault when create brin index on user-defined type.
Next
From: PG Bug reporting form
Date:
Subject: BUG #17884: gist_page_items() crashes for a non-leaf page of an index with non-key columns