Re: Reject invalid databases in pg_get_database_ddl() - Mailing list pgsql-hackers

From Amit Langote
Subject Re: Reject invalid databases in pg_get_database_ddl()
Date
Msg-id CA+HiwqFenEgD4W1QWnHM0whbzWYH=uS6qQzxvKNH7z503HWvxw@mail.gmail.com
Whole thread
In response to Re: Reject invalid databases in pg_get_database_ddl()  ("Euler Taveira" <euler@eulerto.com>)
Responses Re: Reject invalid databases in pg_get_database_ddl()
List pgsql-hackers
On Fri, Apr 17, 2026 at 10:47 AM 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.

Yeah, agreed.

> I suggest a message like
>
>   database \"%s\" is an invalid database

Or just drop it, because the errmsg already says "invalid database %s".

> 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.)

Agreed.

Patch updated.

--
Thanks, Amit Langote

Attachment

pgsql-hackers by date:

Previous
From: Mihail Nikalayeu
Date:
Subject: Re: Adding REPACK [concurrently]
Next
From: Japin Li
Date:
Subject: Re: Reject invalid databases in pg_get_database_ddl()