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 1w3Kwa-0017nz-2l for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Mar 2026 21:30:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w3KwY-002vHH-04 for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Mar 2026 21:30:14 +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 1w3KwX-002vH9-26 for pgsql-hackers@lists.postgresql.org; Thu, 19 Mar 2026 21:30:14 +0000 Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w3KwU-000000004Yg-0lrq for pgsql-hackers@lists.postgresql.org; Thu, 19 Mar 2026 21:30:13 +0000 Received: by mail-qk1-x734.google.com with SMTP id af79cd13be357-8cb40149037so157608985a.2 for ; Thu, 19 Mar 2026 14:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dunslane-net.20230601.gappssmtp.com; s=20230601; t=1773955808; x=1774560608; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=HSKMCJlFR4EWFkc7ZLAoVgpiFjD0QesOWwhOqKK9da8=; b=GMr67EYbQD93068pHCyP3WkZ9DTTPoFuWLCnxgwxGt+2Oqf22mgfjq6J7r9xcAY1T8 0G2fR6JEOG1semDo4qLfw1+NX5pZtzj5gpDMaf3UtT975rGcQhpyN+hb4VVOXz0rtWJQ B8oA+Of5GGsc+tfG6D58vAI3iQVGQuvn1kwknrstPELfUSuGc5i1JwCZbh4mab4DceIP Bv9ek1aAAwuCoYf2KI1+u2fj6gJHMBCp7Je/IA17BmaDlvrqimULHyE6n1zIYy9YN6Lo Dre7BfcPR+8T4+gEM7nH3J+DYPC9Dw5+LrXjMab9NOIqBbM4F0YZcYDT5DANpUIDVp0W 4j9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773955808; x=1774560608; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HSKMCJlFR4EWFkc7ZLAoVgpiFjD0QesOWwhOqKK9da8=; b=qDdEX+U5lEMl8LAwvKAFgRd01y/M+TQd4o3HkXFEhY/PczVVKn5b0jimPuqFpUtFaA dqZ9PKGWeCPI/vMOFPFRNyqLbXMv5LzhOu0BfpsZfJQf/RvbECs5jgG+VecY7rz8EYCS HmTIlq/g0RHhQFtuz/vrhR5o7P0T348pwg6dPydWa02QkTA6uDazAWgLCibUY+6OJ24a X+97AdAb2ZjmYiDEhX9Iu38EfKBnD+26DOgCUjNX/+Gc7dGKmkZHxskz3C7QMe26YkjO g6ye1aPjfrZBTQMDDfwZ6xKqjqGBYt5G74noRjjW0obhvtrqIiBp0lNvzcRHycGMwspG flhA== X-Gm-Message-State: AOJu0YwU9GkSiROsVwLf+7qPXEunNkU8rDjpzEcxkSclvBKkxN8g6eKG 5VdGLQugHzC/wuNVRBI56KJZzpaZFcYzL9IvSnjebrWeNzoiVLppDWVyvI/ompU5tog= X-Gm-Gg: ATEYQzwBgOofIlRfNPcSiMfxB4tdiaK9UMs/fiqZ/sdVOqUtnq2Z80ELitXvCAuLkes WWjMmbROsJ7i2KI0tnv0XyL6iPUk8Ll9ax/xd/uons1bnKDl4I4xVYkNVA/4xkSCS/Yf2rt/Wqc 8u1+RR6OVeTypwCpyjrxAkOcTUhBn3W82VMfII/W06Yf32ctmg8mqi/sJJW2t1ImSjGXTHcQUIj BFsd9OF5zuZFronYy1ENN5ueNx6SZY7YimGsnFUIqtSgYC4acLIb033KXuR1lKRnZ261g4YC0Dn RyRAwnaSKB5tXFKsX6DA6nQx2NlGyL4Ce1RTiFoF20oQU+MWjhg7kOKYpk33pisVElZMc83eMD8 c7sU7WUvbzG4XtqWgXmod3RZPdEkQoB8i6Li2l96lCoxAIhk+spk10U5vBKzaCBZMTlWn9+LzS5 FVqTCbzaX9rAWQ5f48Y7BCd+0QaY5IQmHXFXdwtjMo X-Received: by 2002:a05:620a:4414:b0:8cd:8a55:510d with SMTP id af79cd13be357-8cfc80a154amr128123585a.48.1773955808028; Thu, 19 Mar 2026 14:30:08 -0700 (PDT) Received: from ?IPV6:2605:a601:a6b0:500::1cb? ([2605:a601:a6b0:500::1cb]) by smtp.googlemail.com with ESMTPSA id af79cd13be357-8cfc9088df1sm20696385a.25.2026.03.19.14.30.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Mar 2026 14:30:07 -0700 (PDT) Message-ID: <93b0b82c-754d-4cc3-bec8-b0eb90410c35@dunslane.net> Date: Thu, 19 Mar 2026 17:30:06 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pg_get__*_ddl consolidation To: Mahendra Singh Thalor Cc: PostgreSQL Hackers References: From: Andrew Dunstan Content-Language: en-US Autocrypt: addr=andrew@dunslane.net; keydata= xsBNBE7KWFkBCAClridxur2AIc7eW2AR7izbfp3EnNefie2HbLF0izW5Ik5UjX2HBXBx4syI gY6b0ugohXrr274+baoAlvSbq6cAoQuEVrk5IZFzt20b1Xkx65FwGSEj526yiKLocqkJceSq Xr9xcA5SGY+FZv441chh5SU92v4q6z+6LPpoHOh97ptAVXZYNTtU0LevyvD5lja0TzbvJm6C eFXitJfnm1pLEr0D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BQkd EODdAAoJEJn6f8tZ/DuBfw0IAKTsfD40teP/pp+bsLLMSxPXUYrrprTj7WFB5v61p6dkpSr/ qXmMlyahdxQFaPmfVgVirB1Vk/kHiWNnnGjfUV9nB2Zg9LI0Xb9/ts3LsUiRWXzG3tkMY6XL vsVOxW4XFRND9l2q+WW93aZ1DZl+fqWfYgMvsusFRhmGFOKTRfKPta2Pkv+AhA24N4+PrR5p bU4k2MO8PAGiK8eaYKGFG1bHKuAvoDoF7WXJ3FHxuWqLnKEt4dfOLm5pAe3zq1Lt6q8azT9i QWGpSAK5vQUWQHBHpiDjdPeqKZ6HiAXIIKfSmb+jrvXBqoP+D6/K7rUjG2aXiRtTIAXms9sm VRu7cmw= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-03-19 Th 4:28 PM, Mahendra Singh Thalor wrote: > On Fri, 20 Mar 2026 at 01:44, Andrew Dunstan wrote: >> >> You could construct these functions using plpgsql. The information isn't hidden from non-superusers. So what exactly would making these functions superuser-only achieve? Now it's true that the user might not be able to execute the DDL. But that's not the point. > Thanks Andrew for the clarification. > > Sorry, my question might be stupid. Can we use these functions > directly into our dump utilities so that common code can be removed > and if there is any syntax change for a particular object, then no > need to change into different-2 places, rather we just need to change > it into ddlutils.c file only. Well, we have tried to make the output like pg_dump. We might later provide options for more compact output. But it remains to be seen if it can be used in the pg_dump utilities. After all, it is going to produce output suitable for the source version, since there is no knowledge in the server of future versions. But pg_dump emits SQL suitable for the target version. My original motivation was quite different. It was to give the user a piece of SQL that they could modify as they saw fit, rather than making them start with a blank canvas. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com