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 1ka49l-0000Ua-4c for pgsql-novice@arkaria.postgresql.org; Tue, 03 Nov 2020 21:47:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ka49j-0006gF-0H for pgsql-novice@arkaria.postgresql.org; Tue, 03 Nov 2020 21:47:55 +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 1ka49i-0006g7-QN for pgsql-novice@lists.postgresql.org; Tue, 03 Nov 2020 21:47:54 +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 1ka49g-0002xy-GC for pgsql-novice@lists.postgresql.org; Tue, 03 Nov 2020 21:47:54 +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 0A3LlnsU1046596; Tue, 3 Nov 2020 16:47:49 -0500 From: Tom Lane To: Francois-Guillaume Ribreau cc: pgsql-novice@lists.postgresql.org Subject: Re: Best practice: call an internal postgresql function (e.g. raw_parser) from another C/Rust binary In-reply-to: References: Comments: In-reply-to Francois-Guillaume Ribreau message dated "Tue, 03 Nov 2020 22:38:19 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1046594.1604440069.1@sss.pgh.pa.us> Date: Tue, 03 Nov 2020 16:47:49 -0500 Message-ID: <1046595.1604440069@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Francois-Guillaume Ribreau writes: > I wonder what is the easiest way to extract and (ab)use the raw_parser > function out of postgresql codebase, as a library, so I can use it from my > own code in Rust. You're not the first to have thought of that. I'm failing to locate any relevant threads in our archives, but I distinctly recall having heard of somebody who'd made a standalone version of our lexer+grammar. You might try searching on github. (I make no warranties about how up-to-date any such project may be.) regards, tom lane