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 1lEZcT-0004bv-Ld for pgsql-general@arkaria.postgresql.org; Tue, 23 Feb 2021 15:29:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lEZcS-0005EG-Kd for pgsql-general@arkaria.postgresql.org; Tue, 23 Feb 2021 15:29:00 +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 1lEZcS-0005E9-DM for pgsql-general@lists.postgresql.org; Tue, 23 Feb 2021 15:29:00 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEZcP-00063i-UK for pgsql-general@lists.postgresql.org; Tue, 23 Feb 2021 15:29:00 +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 11NFStJO3822833; Tue, 23 Feb 2021 10:28:55 -0500 From: Tom Lane To: Luka Zivkovic cc: pgsql-general@lists.postgresql.org Subject: Re: New operators and class for jsonb with gin indexing In-reply-to: References: Comments: In-reply-to Luka Zivkovic message dated "Tue, 23 Feb 2021 15:30:09 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3822831.1614094135.1@sss.pgh.pa.us> Date: Tue, 23 Feb 2021 10:28:55 -0500 Message-ID: <3822832.1614094135@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Luka Zivkovic writes: > I am having problems applying gin indexing to my new operator class for > type jsonb. > I created an operator that can query(jsonb column) keys and dates where > dates are more than, less than, equal and not equal to the one provided > inside another jsonb. > Because I want to make it use index search and not sequential search, I > wanted to use gin indexing, but it says that i'm missing support functions. > Did anybody try to do something like this? There's not a whole lot of documentation about this, but there is some: https://www.postgresql.org/docs/13/gin-extensibility.html After reading that, I'd suggest looking into the code for gin opclass support in various contrib modules (hstore might be a good start). regards, tom lane