public inbox for [email protected]  
help / color / mirror / Atom feed
From: Akshay Joshi <[email protected]>
To: Marcos Pegoraro <[email protected]>
Cc: Kyotaro Horiguchi <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Subject: Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
Date: Wed, 24 Jun 2026 13:53:13 +0530
Message-ID: <CANxoLDcRacGAd2Rsmnp=CZjaLMiz7sbCHYo95Rto1OMwJJeOmg@mail.gmail.com> (raw)
In-Reply-To: <CAB-JLwbc=9iqgNiLFHAM0-ZMDD=reFsbDS+QFsSepfwZEtRFDQ@mail.gmail.com>
References: <CANxoLDejn2JFXF7kVMtcznW6XyessrJ7WToSaQau2GxBdAGSUg@mail.gmail.com>
	<[email protected]>
	<CANxoLDe_GOXyyZs7GN3VUJoT+o1DwqZGhid-TWWvS0D8d5ggYw@mail.gmail.com>
	<[email protected]>
	<CANxoLDdq06oXRYuzYfn2gkn3yfoxp=nA14xu5p+qSEOzpHXEMQ@mail.gmail.com>
	<CANxoLDdEBYzKfj3NGrP5PjoTa-eCViWPkFR-sXLq4bUnbokyPA@mail.gmail.com>
	<CAB-JLwbc=9iqgNiLFHAM0-ZMDD=reFsbDS+QFsSepfwZEtRFDQ@mail.gmail.com>

On Tue, Jun 23, 2026 at 7:33 PM Marcos Pegoraro <[email protected]> wrote:

> Em ter., 23 de jun. de 2026 às 10:34, Akshay Joshi <
> [email protected]> escreveu:
>
>> A quick note on a design change I made in the *pg_get_table_ddl* option
>> surface
>>
>
> Much better now.
>
> All options can be present or omitted, so why couldn't the owner also be
> part of the include/exclude options too ?
>
> Just one addition, some options are plural and others are not.
> We have indexes, policies, triggers, but we also have check, unique,
> exclusion.
> You don't know how many indices or checks you have, so wouldn't it be
> better to have them in singular form ?
>

Regarding moving owner into the include/exclude syntax, I prefer keeping it
as a top-level boolean for now:
1) It aligns with existing sibling functions (pg_get_role_ddl,
pg_get_tablespace_ddl, and pg_get_database_ddl), which all use a boolean
owner.
2) Existing regression tests and early callers pass owner => false for
output stability. Moving this into the exclude list would create
unnecessary churn that I'd prefer to avoid bundling here.

As for the naming inconsistency (singular vs. plural), you're entirely
right mixing indexes/policies/triggers with checks/uniques/exclusions was
an oversight. Note that I left statistics alone to match the CREATE
STATISTICS keyword.

I'll address the naming consistency in the next patch.

>
> 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], [email protected], [email protected]
  Subject: Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements
  In-Reply-To: <CANxoLDcRacGAd2Rsmnp=CZjaLMiz7sbCHYo95Rto1OMwJJeOmg@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