Re: Reject invalid databases in pg_get_database_ddl()
Amit Langote <amitlangote09@gmail.com>
From: Amit Langote <amitlangote09@gmail.com>
To: Lakshmi N <lakshmin.jhs@gmail.com>
Cc: Hu Xunqi <huxunqi.08@gmail.com>, Euler Taveira <euler@eulerto.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>,
Andrew Dunstan <andrew@dunslane.net>
Date: 2026-04-17T04:22:19Z
Lists: pgsql-hackers
On Fri, Apr 17, 2026 at 1:21 PM Lakshmi N <lakshmin.jhs@gmail.com> wrote: > On Thu, Apr 16, 2026 at 8:31 PM Amit Langote <amitlangote09@gmail.com> wrote: >> On Fri, Apr 17, 2026 at 11:49 AM Hu Xunqi <huxunqi.08@gmail.com> wrote: >> > On Fri, Apr 17, 2026 at 10:16 AM Amit Langote <amitlangote09@gmail.com> wrote: >> > + /* >> > + * Reject invalid databases: datconnlimit = -2 would be emitted as >> > + * CONNECTION LIMIT = -2, which cannot be executed. >> > + */ >> > >> > This comment looks a bit too centered on datconnlimit=-2, but the real issue is that an invalid pg_database row should not be deparsed into DDL. So, maybe rephrase like: >> > >> > /* >> > * Reject invalid databases. Deparsing a pg_database row in invalid state >> > * can produce SQL that is not executable, such as CONNECTION LIMIT = -2. >> > */ >> >> I was trying to be precise about datconnlimit = -2 being the thing >> that produces invalid SQL. But your version covers that with the "such >> as CONNECTION LIMIT = -2" example, and it's closer to the original, >> which was on the right track, just needed to be more precise. Let's go >> with it. > > This looks good to me. Thank you for reviewing and making the changes! Pushed. -- Thanks, Amit Langote
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Reject invalid databases in pg_get_database_ddl()
- cda0c4c5d6f5 19 (unreleased) landed