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 1q2WdM-0005bW-O6 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 May 2023 12:33:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q2WdL-00025b-Ka for pgsql-hackers@arkaria.postgresql.org; Fri, 26 May 2023 12:33:27 +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 1q2WdL-00025R-BW for pgsql-hackers@lists.postgresql.org; Fri, 26 May 2023 12:33:27 +0000 Received: from relay3-d.mail.gandi.net ([2001:4b98:dc4:8::223]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q2WdH-002Gyn-HO for pgsql-hackers@lists.postgresql.org; Fri, 26 May 2023 12:33:26 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 184C060009; Fri, 26 May 2023 12:33:20 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------t7lExWNmJPD0BDRO1Dd5JaL5" Message-ID: <36562be6-e660-4cf9-5b05-b73d5effecd0@dunslane.net> Date: Fri, 26 May 2023 08:33:19 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: Adding SHOW CREATE TABLE Content-Language: en-US To: Jelte Fennema Cc: Pavel Stehule , Kirk Wolak , pgsql-hackers@lists.postgresql.org References: <1565715.1683923271@sss.pgh.pa.us> <1aac01a1-d9db-8048-9bfa-1e4f9bb69a03@gmail.com> <6afd776b-45cf-2675-0cfe-981f1c6ade1d@dunslane.net> From: Andrew Dunstan In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------t7lExWNmJPD0BDRO1Dd5JaL5 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2023-05-25 Th 09:23, Jelte Fennema wrote: > On Mon, 22 May 2023 at 13:52, Andrew Dunstan wrote: >> A performant server side set of functions would be written in C and follow the patterns in ruleutils.c. > We have lots of DDL ruleutils in our Citus codebase: > https://github.com/citusdata/citus/blob/main/src/backend/distributed/deparser/citus_ruleutils.c > > I'm pretty sure we'd be happy to upstream those if that meant, we > wouldn't have to update them for every postgres release. > > We also have the master_get_table_ddl_events UDF, which does what SHOW > CREATE TABLE would do. Sounds promising. I'd love to see a patch. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------t7lExWNmJPD0BDRO1Dd5JaL5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 2023-05-25 Th 09:23, Jelte Fennema wrote:
On Mon, 22 May 2023 at 13:52, Andrew Dunstan <andrew@dunslane.net> wrote:
A performant server side set of functions would be written in C and follow the patterns in ruleutils.c.
We have lots of DDL ruleutils in our Citus codebase:
https://github.com/citusdata/citus/blob/main/src/backend/distributed/deparser/citus_ruleutils.c

I'm pretty sure we'd be happy to upstream those if that meant, we
wouldn't have to update them for every postgres release.

We also have the master_get_table_ddl_events UDF, which does what SHOW
CREATE TABLE would do.


Sounds promising. I'd love to see a patch.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------t7lExWNmJPD0BDRO1Dd5JaL5--