Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements - Mailing list pgsql-hackers

From Marcos Pegoraro
Subject Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
Date
Msg-id CAB-JLwY1O-owU39ebG=fJZo0z2j+2z=y5R+w8pmpHx9GNqvnOw@mail.gmail.com
Whole thread
In response to Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements  (Akshay Joshi <akshay.joshi@enterprisedb.com>)
Responses Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
List pgsql-hackers
Em qua., 1 de jul. de 2026 às 11:12, Akshay Joshi <akshay.joshi@enterprisedb.com> escreveu:
pretty, owner, tablespace, and schema_qualified are plain boolean parameters with DEFAULT values
Filtering parameters: only_kinds / except_kinds as text[] 
If all parameters are optional, and all parameters are boolean, perhaps you could also make pretty, owner, tablespace, and schema_qualified as optional parts of only_kinds and except_kinds.

Therefore, we could call these two ways and the result would be the same.
pg_get_table_ddl('idxd'::regclass, owner => false, tablespace => false, except_kinds => '{primary_key}');
pg_get_table_ddl('idxd'::regclass, except_kinds => '{primary_key,tablespace,owner}');

Obviously this way you have to know if owner param is false or it exists on except_kinds. 
What do you think ?

regards
Marcos

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: Re: The PostgreSQL C Dialect
Next
From: Kirk Wolak
Date:
Subject: Re: [GSoC 2026] - B-tree Index Bloat Reduction - Approach & Questions