Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wcItR-003FPK-1H for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2026 08:23:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wcItQ-00GAjU-0W for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Jun 2026 08:23:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wcItP-00GAjM-2e for pgsql-hackers@lists.postgresql.org; Wed, 24 Jun 2026 08:23:31 +0000 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wcItL-0000000258y-3W37 for pgsql-hackers@lists.postgresql.org; Wed, 24 Jun 2026 08:23:29 +0000 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-69531108f25so1246408a12.2 for ; Wed, 24 Jun 2026 01:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782289406; cv=none; d=google.com; s=arc-20240605; b=JyN1XFD0V+pHZy6ENfnLPMHI6sn4q7D06MAcBgOiJ7WNAP6EKke+jkLQMFL8kYf0s3 58vWGLfj+FZnkKc8FgddyxUG6KFcDxEitr47C9ddYI52CGMveDqAyGPFcrsHmzRsgbP5 4aeHOW7ZGVNATngVvJ37T070DsPFZ252b1ONi3ecww17O51eR3XXl/lHoAKcs5FgAwg1 2iYF+eA4zbyTkmlAl2g8+wl0o6Btl5F4JgCndDI3brC+YjjtydPPRn0f7DXtfkrVUHPb GkjKiZYlUZdD1xEXMHidTwwVt/TQOASgLVf0pOhtatj12e+Ip+K3poEOzfD09ifVAmmE e9hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=6cyQ7OlWL6VFVydQOfWmU7yx3aHrP/u34r0K65KhlyQ=; fh=IaAfJjxChzjI2j1PNajlYyVmU8tm/RAaJzJ1bhbI12o=; b=PRjpcv03D72d8xnoZgEH0CTDr1ojo379ntL5rPEqvjdsNp1mFlfyP+5bfBmfDLWpSD 7U+J+BYGAD9/Yvs2MfFsorsf4LoQW2mdk40xzvkGo/wcs3UNNDragLi3FXfiC6+izMCo MiJceUS4wUy/Lah9EzBZpnxr8ICyk1vvQESwUPUfvrIdjifH40nEn3/qqOJpLr8Axfhq u2N3A7EpdX5dJYHlSU70VRWYUz4QHFSqTmzCUXCtGxjHpYJ0mlEB+kwr+aeT63GNLguc IAwb0M96mKrQyqowo46vE5UoiXYZX0haQ9K4FwRLIjM0LW/Z4q9wUBjMI8cYe/l9E7VT RLNQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1782289406; x=1782894206; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=6cyQ7OlWL6VFVydQOfWmU7yx3aHrP/u34r0K65KhlyQ=; b=Bax+5gLRy5lOJqMIMTsK52vV3jVOmGwPNyVKK1htWzMk75R1y1A8qBo93bnU1VOgsd cc9ONfpWy0RMBw3OESVRvjV5G1pJjrh56dGLUtdR8P6USXTpxf1ONHUC4t4NhrQL7oOw sJWgqgJptPtWWsaUSXSrnGHDHhcNr5f8hsyOuQZwLh1IzRrS/RSfThDAFVxEAbuc4tKz FeJ+M+b7+Hby7hxKZDkxHqi+WaX1d2ZqbUTlGvbfUwrNMm+GOBS8ga+HCp54jHBMzgmK em46G7TGWNJcaSTeji5H5h1tCWv70iuaCgUVRwvVCkLJuCUa5nODeYRC7dX6fit8/D1D ZW/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782289406; x=1782894206; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6cyQ7OlWL6VFVydQOfWmU7yx3aHrP/u34r0K65KhlyQ=; b=gRMpOnTigZ5pKZsBrOtW8QmjfXYZJMbMqvArX+8tKztIzgQIb0IJNQvL8spasPjQOM AR+rag4NEkra/Bjo1k2AgkTzNfVD7PognCkgJWNghWPnlBtaq/+UubD5EwgQiH65jL1X Y22chC8XbwON0Q31rjn+JjZpU3hil3VIXGe7yzQDTApw/nLzNp2kbwOeJ0jPsPFd/lSh 77HfQV/nIuM/h/Hg+YQW/Vr3GuXrEjvXK3ctHPB8iqlhsYUt2QbTcsQufPk4sZb2sWSL RpQLwr3QIHhDQGAPzbNhtn2eLittu3NpMwI0CnIkfePHBZ44iR6SbGRfArtRjdYNm7Zk dwoQ== X-Forwarded-Encrypted: i=1; AHgh+Ro2jjNQS+ryuMRzG2//L5zpYX/TRjSPF+VRUhdO2jnHXnjc6gIwb0vghftlg+HJu5rAVqNQHbsq9qPVxzyZ@lists.postgresql.org X-Gm-Message-State: AOJu0YxH0hRp85JHLYCsIrLWJS37VicQanlus2pWfBP64au9WDawT2fI JwcRTBETKAyJyM7hUQEvBbuFxK5CHoNEiez8BX+8GvvvQcZWtdY1ovFT64KBNA5ORmHc5Jpz8GQ WSBZ7c2b/epX+02DjFxlIb3XC2x5JGWfN51EZf/MiAuCy7TBGan+ZwsE/ X-Gm-Gg: AfdE7ckb9LaEvndy4ns1JttLTVgDHoCFMnTFzo00HsYXVUmsODKmwlGh+w6b+u3l398 Kbf8InfuIWx74n4K1NdO4zPsu/Gn7vrIMFlyD0kfocXbGQvsrGE3+vvuU7a0d33Jvqo2uBCsYni 3rEDJnoN7SzanN9BIe7JpJqvcW+v9Dq29yftgQmi21ICPa919hg3DGIP/bDPm5Rxp/Uw3xXNYIR kQy5lcjOCyrtfuTjQZslKaahUxD2br2kx4RHT4izpNAs9Jy05L5w8xCiWQ9aBFu5jtqvb0HTL/P Ju7q//x+SA== X-Received: by 2002:a05:6402:a601:b0:697:4307:991d with SMTP id 4fb4d7f45d1cf-697f3aab4cbmr560825a12.19.1782289405825; Wed, 24 Jun 2026 01:23:25 -0700 (PDT) MIME-Version: 1.0 References: <983C7B03-D9C3-4F15-8913-7616EC5E6414@gmail.com> <20260623.162104.775158751399277188.horikyota.ntt@gmail.com> In-Reply-To: From: Akshay Joshi Date: Wed, 24 Jun 2026 13:53:13 +0530 X-Gm-Features: AVVi8Ccfmn2w94u89cXb7bX2CAVW_H0Gi79TIAjgeIaCaYTfYy06KYkgxeKkCvE Message-ID: Subject: Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements To: Marcos Pegoraro Cc: Kyotaro Horiguchi , li.evan.chao@gmail.com, zsolt.parragi@percona.com, pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000ebf0950654fb9633" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ebf0950654fb9633 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 23, 2026 at 7:33=E2=80=AFPM Marcos Pegoraro = wrote: > Em ter., 23 de jun. de 2026 =C3=A0s 10:34, Akshay Joshi < > akshay.joshi@enterprisedb.com> 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 =3D> 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 > --000000000000ebf0950654fb9633 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Tue, Jun 23,= 2026 at 7:33=E2=80=AFPM Marcos Pegoraro <marcos@f10.com.br> wrote:
Em ter., 23 de jun. de 2026 =C3=A0s 10:34= , Akshay Joshi <akshay.joshi@enterprisedb.com> 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 pres= ent or omitted, so why couldn't the owner also be part of the include/e= xclude options too ?

Just one additi= on, some options are plural and others are not.
We have indexes, policies, t= riggers, but we also have check, unique, exclusion.
You don't know how m= any indices or checks you=C2=A0have, so wouldn't it be better to have= =C2=A0them 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 func= tions (pg_get_role_ddl, pg_get_tablespace_ddl, and pg_get_database_ddl), wh= ich all use a boolean owner.
2) Existing regression tests and early call= ers pass owner =3D> false for output stability. Moving this into the exc= lude list would create unnecessary churn that I'd prefer to avoid bundl= ing 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 th= e CREATE STATISTICS keyword.

I'll address the naming consistency in the next patch.=C2=A0

regards
Marcos
--000000000000ebf0950654fb9633--