Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjfvi-0007IV-NN for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Apr 2023 12:38:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pjfvh-0005fM-Ko for pgsql-bugs@arkaria.postgresql.org; Tue, 04 Apr 2023 12:38:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjfvh-0005fD-CI for pgsql-bugs@lists.postgresql.org; Tue, 04 Apr 2023 12:38:29 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pjfvd-000paJ-Vy for pgsql-bugs@lists.postgresql.org; Tue, 04 Apr 2023 12:38:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 334CcM321372027; Tue, 4 Apr 2023 08:38:22 -0400 From: Tom Lane To: linwenbo1994@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17883: Segmentation fault when create brin index on user-defined type. In-reply-to: <17883-7bb64f11e60bc1ef@postgresql.org> References: <17883-7bb64f11e60bc1ef@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 04 Apr 2023 05:51:56 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1372025.1680611902.1@sss.pgh.pa.us> Date: Tue, 04 Apr 2023 08:38:22 -0400 Message-ID: <1372026.1680611902@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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