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 1wDYIf-00368O-31 for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Apr 2026 01:47:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wDYIf-007TVn-02 for pgsql-hackers@arkaria.postgresql.org; Fri, 17 Apr 2026 01:47:17 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wDYId-007TVe-2x for pgsql-hackers@lists.postgresql.org; Fri, 17 Apr 2026 01:47:16 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wDYIb-00000001Orp-1mbe for pgsql-hackers@lists.postgresql.org; Fri, 17 Apr 2026 01:47:15 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 62A11EC013B; Thu, 16 Apr 2026 21:47:12 -0400 (EDT) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-06.internal (MEProxy); Thu, 16 Apr 2026 21:47:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1776390432; x=1776476832; bh=N6rceVh66C+47WxmjKNAqC+WSFgs+8CBIR0ocFZc8AI=; b= S86+Hm4GklG1VvS5klLORzX7vLeThvxCIHLYKl8ydA/C19h19CmN3kSUIalPqBA0 v3JjoOvcnfhE+OwlzOimQZROVBY/tt0kp6OSnw2KnnDQneS/yx03g4P8s6T5IKdL RVg+GQsOxeDDfVCBOhuonzCIGSYwHOCqRsnRy3yEczpT2VZlr1Z5rPDTnfANH2tS isEanluXBK3G1xabe/OnGEFGMX60fmCcB7MH5qsurpk3vikkagFyjw7pl8oaY1C5 wZ+MSNb1i48G+rxwl9q860+o03ORVCjMEo/1e1kiuJT6V5i10LayCSawA2Zt1POh W4G1I85PfHe+xkCtk0Ccrw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1776390432; x= 1776476832; bh=N6rceVh66C+47WxmjKNAqC+WSFgs+8CBIR0ocFZc8AI=; b=h eA901sQGoiZQg09GNvQT4EmRvS5WbQq3ZnsbkW8fKJWfsuIaMfzwHM/IE23dc+Mw dnUu0luq6M6qOGks3rOVRTuzMgcLlMbYqV7ZngVNJah6sFeMcfuMB9V215NnrEa5 gpDbUoOJTJGiRWRgdY16s5aL41RL1ZXY7HHaslF0EJSqUCyPhlKZz3DVbobIDFuN A+onF4Zt0uENI6Q3ms9iKJ04lEqCEM3H/9LAY+yQ31o3nfsPYeLLKDOyfdaWQbHI zXiCeZeFGbPXMT0yUb5MOCdbGBydfseKAZMYBZiHH8lgQdRu3KLLxdRJVsFZGbDq xfv58gPrQIucUSpnUjYJQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdegkeeitdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvvefkjghfufgtgfesthejredtredttdenucfhrhhomhepfdfguhhlvghr ucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvghrthhordgtohhmqeenucggtffrrg htthgvrhhnpeelvefgieelgeffgfelgfeffeffgefhfedvfedtuddvffeiieejffduleei hfdvveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvghulhgvrhesvghulhgv rhhtohdrtghomhdpnhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtg hpthhtoheprghnughrvgifseguuhhnshhlrghnvgdrnhgvthdprhgtphhtthhopegrmhhi thhlrghnghhothgvtdelsehgmhgrihhlrdgtohhmpdhrtghpthhtoheplhgrkhhshhhmih hnrdhjhhhssehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghr sheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 065D3182007A; Thu, 16 Apr 2026 21:47:11 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: AcG5lZtogRmZ Date: Thu, 16 Apr 2026 22:46:51 -0300 From: "Euler Taveira" To: "Amit Langote" , "Lakshmi N" Cc: "pgsql-hackers@lists.postgresql.org" , "Andrew Dunstan" Message-Id: <976a432b-9221-4825-8e8f-41f4375737fe@app.fastmail.com> In-Reply-To: References: Subject: Re: Reject invalid databases in pg_get_database_ddl() Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Apr 16, 2026, at 8:46 PM, Amit Langote wrote: > > Thanks. Will push the attached shortly. > I think the errhint() is excessive in this context. It makes sense if you are executing ALTER DATABASE, for example. I suggest a message like database \"%s\" is an invalid database Regarding the test case suggested by Japin Li, I don't think it is worth because it is a transient state (unless something bad happened and pg_database contains a dangling row.) -- Euler Taveira EDB https://www.enterprisedb.com/