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 1w59kP-002xBK-14 for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 21:57: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 1w59kN-009FtK-2g for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 21:57: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 1w59kN-009Fsj-1a for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 21:57:11 +0000 Received: from mail-yw1-x112a.google.com ([2607:f8b0:4864:20::112a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w59kK-00000000x4d-2AJH for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 21:57:11 +0000 Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-7991db3dc98so23952137b3.0 for ; Tue, 24 Mar 2026 14:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774389427; cv=none; d=google.com; s=arc-20240605; b=ToPP3IE8Y7vU7tfIc0vpoPMsWMu7vJA9bnSV2ZW/GN9ioLfQmIBxUA8FI0saPQu9Xj SWruQdtP9iVgmOLAsLiGiN8zl5wMFMnsbSAPtviKDlqQ02GMMdRz1v7FGm9ZNwhyv9B4 vjk2SVyjvgcJtoZz8HkRzvppL4lpBuN1b2h7G8z+7cdm7/nJAUS8p8Z2e6p2XhWIHLcT 0Vher9yHJPmtq0MwFw+eYEiDtwfEEQDx13TwaleV10aZbJ3dAswC40FpdO6ew5K25QB+ dsRL/5eSh8HbYKLiZz3oUpBNbU1v1CeFiZz4/3APWeIxBazxE4N666+g6yJ5RODS5xR8 qxqw== 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=3MqiMsK+zF0cwmRqsph0bcVJmEV/QqB+AmC/q4B3MxQ=; fh=fRdh6uu3oz7cCu/SOCIEHfTmmu5yZg/ej+Bgc6dhSEE=; b=WiyXWHsq6srb4IkutSJCP5j9oXf3yTkqHVfQA7p7BeEjf8y9iyHHOHrxNDlOl4JyYo uAolHG3Bw0/Sk6bCkt6cM/g7Av+d1JlnEjtU0PcaNX5idhFNbv0pJvL9WfHstoJRK7O5 LXLsOWbPsCOXMzBCe6PFUoEqLjWFHtSvpihkCpPYFLRy35YBIQvySIXq18SRf0OuSxiI Ia5oQc86vbFpTAkFOvQ5rR/Q4Jc6XVPtG8RiZO2fG0vfdMav4FfPG5RZ9FTq1xK33TuZ iuzet6rwf2/Cy8M+NoCr3SigT34qGcNn//7CTHfLr/WAqbgWdFWjlBLy6FhTG8flEfHq Kx2Q==; 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=percona.com; s=google; t=1774389427; x=1774994227; 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=3MqiMsK+zF0cwmRqsph0bcVJmEV/QqB+AmC/q4B3MxQ=; b=IvhKl0CVvg/qVx8eyhQ10GdH+w0AGYmeb89b2Sh1cskkZN6pV21sVHlOov2rR2sf86 hbFkUWvPiZg8/RqKPxkQ3YuFp9Py8uY3o0D5V29nPSC2DG1QSnpwAvvJYNqZxN1kwS8y 86JscV9C5WkgIhwVdoX7sQ52X7Lk5+3I+uaaE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774389427; x=1774994227; 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=3MqiMsK+zF0cwmRqsph0bcVJmEV/QqB+AmC/q4B3MxQ=; b=rgFB6UT7mZ/ZqWakgRZJChulSDc2dVIBBatD3wbkWd00K0jXkXwyRvGUloZMFOjzBC QoDwOGGmych5UpNSAaJFvAhb3mBnI5ZkuFfveNHXNbNfLG/U72yq0ar0ONStO2Qui+Xz QKNVMFRhu7Gi9etsSy063n8roE+u4SSokt9zRe1IjLpHCmmKQYPjmc8diinJoH5tr16g RvehK1tN6s+V0ygGgO83EUoZypWC2wTVOIAx6mAygO0Qe6dFieUnoZ1G1ZfDZvbMJosf hDfme6NLByZ8f5WjJky7ogP0365jTvzFi+83+Yin4rBnqd2mEVr7jF4YsDlu6c8NdfYT p76A== X-Forwarded-Encrypted: i=1; AJvYcCWR71Lkdifl4R+5ykZHHuqJhMQ9ZSzZP5/O8K7aqhYWjBhSQO9cU+KRs7rEbEQoIHgQDRI7L5bezc3a0UYL@lists.postgresql.org X-Gm-Message-State: AOJu0Yy2GH0CE5yu4Co/shiQxUD5XQkYzVfdrgHHmz/YjXABCHDuG/Xr ug7Py1BU4a9Y+9YZYPWBnypnRsLZpGGakATE7QW0pGVaZhm6Ro/FkygV/xx2oXokWVBt5U+nrQ3 bH0blrcOKbQ1f8dbvI1y3PErHFGaVqeJ4gkKbAsv/g6dxFXNnQqb5zBJA2J+TtlT38vS71Y4tgW PnYwwdVCL3RCrt7QLpp6v2AOc1AO+adf6FP6eBvYI5weU3kp0t0zH0R+5nETDkK50prAZoc5esY Wp4PpiRRE+Rx7virsluUDRuuxadKYpZkFxwzI1lvikyauSWhzYjZQE/0nifauoQtDk= X-Gm-Gg: ATEYQzwN3YIrU6B6XNSs8iZbA7nND6B7ePJ6a9Jw/FzZ5+JN931fzRecYt2oZNtbZkK nDsCKXczEUprP0ZSWXg1JgNxSn/PfsbECPUJpOkoRNCHRvsFZCdyi4tWiRaYtLJdIQ/Yzdgr+i9 WTMKnBL5ut8zCwJFHQoNFhhVdhC3VJtO7NNY1RrjEBpKmgA61r5I2THwOLUY16Lzf3mHoI9FGRP gnQUBcX3pYwwtyMrSJa4k3LfPVF9djI0wv962DZ32UX7uGdD3JKsN4bCA3bpDTnav4Bm0hh13BW 1cEr5iY0uRyiSHwA4gwWx1xd2HB88bnEaZGqxXeZPUYSUkW/TCQPuT+5cO1jqUi6O3BQ X-Received: by 2002:a05:690c:a:b0:79a:4fe4:ff3d with SMTP id 00721157ae682-79acf67f9e7mr15042137b3.39.1774389426502; Tue, 24 Mar 2026 14:57:06 -0700 (PDT) MIME-Version: 1.0 References: <202603201311.yhtqmvektawm@alvherre.pgsql> <8ec9b67d-939e-4b22-8d56-a5129f92d32d@app.fastmail.com> In-Reply-To: <8ec9b67d-939e-4b22-8d56-a5129f92d32d@app.fastmail.com> From: Zsolt Parragi Date: Tue, 24 Mar 2026 21:56:56 +0000 X-Gm-Features: AQROBzDI1XFLiQFaPaKEeegtps0QqChpW5v51yTZkCRYKFP1s0gmqcVkiZijtBs Message-ID: Subject: Re: pg_get__*_ddl consolidation To: Euler Taveira Cc: Andrew Dunstan , =?UTF-8?Q?=C3=81lvaro_Herrera?= , Japin Li , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk v2 is definitely better, I can confirm the improvements. > including all suggested changes in this thread But I want to point out that the permission check question, and the role membership question is still open. For the membership question > I'm not opposed > to your idea but IMO it should be an option. I'm also fine with leaving it out, but then it should be a mentioned limitation. For v2: Shouldn't the tablespace function also support an owner option similarly to the database function? A pfree(nulls) and pfree(spcname) seem to be missing, all other variables are freed properly. + + /* + * Variables that are marked GUC_LIST_QUOTE were already fully + * quoted before they were put into the setconfig array. Break + * the list value apart and then quote the elements as string + * literals. + */ + if (GetConfigOptionFlags(s, true) & GUC_LIST_QUOTE) + { This part seems to be duplicated between the two functions, maybe could be a helper? +ALTER ROLE regress_role_ddl_test4 SET search_path TO 'myschema, public'; Maybe it would be useful to also test the "SET search_path TO myschema, public" variant, without quotes? I also want to go back to the datestyle question one more time: > The non-fixed DateStyle is by design. It mimics pg_dumpall. Isn't pg_dump and pg_dumpall inconsistent in this? pg_dump sets it to ISO, pg_dumpall uses DateStyle. So I'm not that sure about the "pg_dumpall works this way" argument because pg_dump works differently. Maybe either of those tools should also be fixed? The pg_dump behavior is actually a bugfix in cf4cee1b, which was never applied to pg_dumpall, so it seems like an oversight to me? > At present, dates are put into a dump in the format specified by the > default datestyle. This is not portable between installations. > > This patch sets DATESTYLE to ISO at the start of a pg_dump, so that the > dates written into the dump will be restorable onto any database, > regardless of how its default datestyle is set.