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 1wbvRZ-002x76-25 for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jun 2026 07:21:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wbvRY-00AAPs-1D for pgsql-hackers@arkaria.postgresql.org; Tue, 23 Jun 2026 07:21:12 +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 1wbvRY-00AAPj-0D for pgsql-hackers@lists.postgresql.org; Tue, 23 Jun 2026 07:21:12 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wbvRV-00000001sjy-3K1w for pgsql-hackers@lists.postgresql.org; Tue, 23 Jun 2026 07:21:11 +0000 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-84537777d45so4238863b3a.3 for ; Tue, 23 Jun 2026 00:21:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782199267; x=1782804067; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=TytiHO57iMNVOxDcnckvW6gw3ZPCmuA6hpEfQpR138k=; b=h+l/Lt555ymEiQf+aDzZhXoD9sZEB7V2coIZB+iVdyzR9rEx67im1ivBkl1V/2idyt NoamLGzYx+FbFenAkM+TI7vmOK7Zo7qh95+r+j+AEHr7dyaGGdUxKzEAghM5cG+Z/YVG bdLCbZITt6PapXj2ap697FI8nEeQYGS65BXRBWCe5MSl1Y20y1abeXUKkx/ZOla4LtCk wwNWk8+Y2Nnk1Fu5GcS+QYCQPFdEC79sqAZOSH/mq/Bs/dsG5sK5LQLZdZI7WQfmET7s Mo/Z6I4URhlJcjPzqL91PizZgfjxp0hcKTipCp6QypcLgTsJTGadKrP6T3KmQDD1czzL dEfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782199267; x=1782804067; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TytiHO57iMNVOxDcnckvW6gw3ZPCmuA6hpEfQpR138k=; b=GxKDPbeq0Nef3ZXdEsJAiutCR/CFtUV6U5NNhQ/jhLj+VZ7QhckjpEeKD8kG4fxdpR EzFFLJ6adkO4KsnDxk61GOqnWcvLZwJcZf77XpeLt/pNafUuTS5Oa9ibYQJ/h3lq2RWx C2sid0yG3D9R+NtfYDjaFnqbLS4Go1jTUD78G6jNmORbcSCeEYEFNO5y9sj7tARSY2dX Mlcs/t5KVM3/NgMXvUgAB+o3+01VX/gx3sXICYu8OLc8T16yVcMWUa4/Ndg6k9KEHP/1 sg6z0SteV5W6MZuJJ9RH+1iXEfACBiiHsY9dA9XZg5kHMIU4+jTWmjQs1ZmWbBT98W8t qiuw== X-Forwarded-Encrypted: i=1; AFNElJ/HRjfpEz+oev2rbDG8aIQ7t5Q3xXTXNzOB0VtXZxOFfJKFZhqHwt9E5X//r5IFhJf+mnCcCdHhZCcbEhds@lists.postgresql.org X-Gm-Message-State: AOJu0YzmesorpOYYW7AOrzLAmKfhf/XPwnQlRu3UitucpHDjoSqNXW8M TZq3N0xEna7In3PU+AzmSoivA4n0chip9wE4JUsQDIICRfwETXuwV8ff X-Gm-Gg: AfdE7cnOPfNBPqJZ/o1ZaVM1X/k5cGND8++cP+FXiMyIrKTSNoI74Q/mVpXa8k+350W RFVSxgV70VDIJhoZgltZS+y1WlqGeIOQalX9bDaFTvAhj4RU05blKKfBGk1rH88aNyzD5w9swKN sEJ8hhhYAp4LhQNPmrJhCu3m/oJ/6LJeJ/SQbrg8Zmc8/N04mYE4XOZpdKd32KX21NiHokySGbN pCJeqh0AovmTCD4sGWb9qnVVasLUIvfax4R2Aa04e9SLeDVpnokwIa1Rvv8O8pE1pXtjSOcFh8y ZUCjJ5/VP4ChMVjXVT32BVHgxrAOVq78405O3IPJGJ+AMW2W5DpoLU5u9/PH7sheqIalWoLFaMg y6hVBSjbmUY7x2d8yUCNj2+jI5LQT17fZn8+M0l2hVcUa6EJKo97DrrBv/f6qmS0yE3xr6WDS2s bN07xFTyMvz1Wr94YzNB6CPfJ6uajN2TJkxqDA2gLZWMd8WqLYatBfWaLHouKn X-Received: by 2002:a05:6a00:4206:b0:845:4d71:8d15 with SMTP id d2e1a72fcca58-845508a31b5mr19743338b3a.37.1782199267239; Tue, 23 Jun 2026 00:21:07 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84564eca7fcsm9764018b3a.52.2026.06.23.00.21.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jun 2026 00:21:06 -0700 (PDT) Date: Tue, 23 Jun 2026 16:21:04 +0900 (JST) Message-Id: <20260623.162104.775158751399277188.horikyota.ntt@gmail.com> To: akshay.joshi@enterprisedb.com Cc: li.evan.chao@gmail.com, zsolt.parragi@percona.com, pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] Add pg_get_table_ddl() to reconstruct CREATE TABLE statements From: Kyotaro Horiguchi In-Reply-To: References: <983C7B03-D9C3-4F15-8913-7616EC5E6414@gmail.com> User-Agent: Mew version 6.8 on Emacs 29.4 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Mon, 22 Jun 2026 18:10:53 +0530, Akshay Joshi wrote in > The v9 patch is ready for review. I have not looked closely at the DDL generation logic itself, but I have a few comments on how pg_get_table_ddl handles its options. Since pg_get_table_ddl_internal() appears to copy these values into TableDdlContext almost immediately, I wonder whether TableDdlContext could be initialized by the caller instead. Using positional boolean arguments is probably fine when there are only a handful of options, but with around fifteen of them the current approach seems somewhat error-prone. It might also be clearer to initialize the default values first, and then override only the fields corresponding to explicitly specified options, rather than folding the default handling and option lookup into the same expression. Regards, -- Kyotaro Horiguchi NTT Open Source Software Center