Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
Marcos Pegoraro <marcos@f10.com.br>
From: Marcos Pegoraro <marcos@f10.com.br>
To: Akshay Joshi <akshay.joshi@enterprisedb.com>
Cc: Zsolt Parragi <zsolt.parragi@percona.com>,
pgsql-hackers@lists.postgresql.org
Date: 2026-07-01T15:10:49Z
Lists: 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