Re: BUG #18705: Segmentation fault when create brin index on user-defined type.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Vondra <tomas(at)vondra(dot)me>
Cc: Tender Wang <tndrwang(at)gmail(dot)com>, 503699317(at)qq(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18705: Segmentation fault when create brin index on user-defined type.
Date: 2024-11-15 15:47:14
Message-ID: 2448486.1731685634@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tomas Vondra <tomas(at)vondra(dot)me> writes:
> On 11/15/24 07:17, Tender Wang wrote:
>> Can we report errors not crash if users pass an unexpected function?

Read up on the halting problem.

> I think it might be improved to do some checks, yes. The CREATE OPERATOR
> CLASS should be able to signatures of the functions - it's AM-specific,
> and there's a limit how much can be checked. For example these functions
> have "internal" arguments, which can be an arbitrary pointer.

We already have amvalidate, which would certainly have caught anything
as egregiously wrong as this example. I do not remember why that's
not a forced step of CREATE OPERATOR CLASS, but I'm sure there
was a good reason for making it separate.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-11-15 23:54:00 Re: Today's Postgres Releases break login roles
Previous Message Tomas Vondra 2024-11-15 15:38:45 Re: BUG #18705: Segmentation fault when create brin index on user-defined type.