public inbox for [email protected]  
help / color / mirror / Atom feed
From: Akshay Joshi <[email protected]>
To: Marcos Pegoraro <[email protected]>
Cc: Zsolt Parragi <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
Date: Tue, 23 Jun 2026 14:27:54 +0530
Message-ID: <CANxoLDdUKppozj6oHawQeTNmO=vamCbYe86VHdqOwJT8ComhSw@mail.gmail.com> (raw)
In-Reply-To: <CAB-JLwYLFJ9aroD0V9VWWWfrMQFQVRv4dZgJKmCFEs+JMoNQ7g@mail.gmail.com>
References: <CANxoLDfjQnhM=E6JSyYo9s9OdjqoN8s_3wE5yL=kaDu_X8j-dA@mail.gmail.com>
	<CANxoLDcxmXNHNyPt5v+LaBJVJmyt=j95D7TDE9SepoM7y15t-w@mail.gmail.com>
	<CAN4CZFNqf41TCg1ENccq6DAYQpArCbnKUSidHnRKaVMWGj5pBA@mail.gmail.com>
	<CANxoLDfL1AxL=k9SsRNReKQ-sJUSy6RvCqeog5HWckFxff=0Pg@mail.gmail.com>
	<CAN4CZFP5-fAGwxMCyKGePgp3N8NCpoFXkruO=5xjTC=gPwqYxw@mail.gmail.com>
	<CANxoLDc6UFMsyzbXKF8SpMoXdoKE=-yRPqtvyBMKKJ2zOUKX4A@mail.gmail.com>
	<CAN4CZFMhnZyQsdLC5iZNego77JHJyP6J_4CpWu=99vKHCd-vzg@mail.gmail.com>
	<CANxoLDco7z7Fj7_pj_3YQLvjq8ZH2Ai4c3GcOamed01fZhJ77Q@mail.gmail.com>
	<CAB-JLwY=RYPJhdFid0YDqk1L1OQPuHFz9J2tOeeVCFLjov+Ktg@mail.gmail.com>
	<CANxoLDdRts-F+QxL+wtM8529Z3+TUJku8PKy3WoxcWBs7zQJ-w@mail.gmail.com>
	<CAB-JLwbyzF+JRPCoLCf-H6dQ_1+-O_wBZcESRdC6_H2z+-d-gg@mail.gmail.com>
	<CANxoLDcWwoWOxvmV_uBBUsbGf+_AZzBV1GkcjoX+omNpcrCNMQ@mail.gmail.com>
	<CAN4CZFM99cGopPJXD_t05+Y9CnocOOTipfXCzoAfBUFSC-i4+A@mail.gmail.com>
	<CANxoLDejn2JFXF7kVMtcznW6XyessrJ7WToSaQau2GxBdAGSUg@mail.gmail.com>
	<CAB-JLwYLFJ9aroD0V9VWWWfrMQFQVRv4dZgJKmCFEs+JMoNQ7g@mail.gmail.com>

On Mon, Jun 22, 2026 at 8:25 PM Marcos Pegoraro <[email protected]> wrote:

> Em seg., 22 de jun. de 2026 às 03:27, Akshay Joshi <
> [email protected]> escreveu:
>
>> The documentation paragraph for `includes_foreign_keys` now directs users
>> to `only_foreign_keys` as the intended second pass. Regression coverage
>> adds three cases: the FK-only emission for your cons example, the zero-row
>> result for a table without FKs, and the error path.
>>
>>>
> I still think this model of only having options for foreign keys is
> incomplete, maybe wrong.
> Imagine then cloning a schema from a publication server to be executed on
> a subscription server. So I don't want any other constraints besides the
> primary key, for example. The way you implemented it is not possible.
>
> Furthermore having only_foreign_keys and includes_foreign_keys seems
> confuse.
>

   OK. I'd like to change the model, not just the flag names. Drop the
entire *includes_** family and *only_foreign_keys*, replace them with two
mutually-exclusive variadic keys:



  - include => 'kind1,kind2,...' — emit only these kinds
  - exclude => 'kind1,kind2,...' — emit everything except these





  Setting both is an error. Setting neither emits everything (today's
default behavior, which is preserved).


  *Vocabulary*: indexes, primary_key, unique, check, foreign_keys,
exclusion, rules, statistics, triggers, policies, rls, replica_identity,
partitions. Unknown kind → parse-time error, which also
  catches typos that the boolean version silently accepted.

  If everyone approves the model above, I'll try implementing it.

regards
> Marcos
>
>


view thread (54+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
  In-Reply-To: <CANxoLDdUKppozj6oHawQeTNmO=vamCbYe86VHdqOwJT8ComhSw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox