Re: Reject invalid databases in pg_get_database_ddl()

Japin Li <japinli@hotmail.com>

From: Japin Li <japinli@hotmail.com>
To: "Euler Taveira" <euler@eulerto.com>
Cc: "Amit Langote" <amitlangote09@gmail.com>, "Lakshmi N" <lakshmin.jhs@gmail.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, "Andrew Dunstan" <andrew@dunslane.net>
Date: 2026-04-17T02:30:44Z
Lists: pgsql-hackers
On Thu, 16 Apr 2026 at 22:46, "Euler Taveira" <euler@eulerto.com> wrote:
> 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.)
>

Thanks for clarifying. Got it.

-- 
Regards,
Japin Li
ChengDu WenWu Information Technology Co., Ltd.



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Reject invalid databases in pg_get_database_ddl()