agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Amit Langote <amitlan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reject invalid databases in pg_get_database_ddl()
Date: Fri, 17 Apr 2026 04:21:56 +0000
Message-ID: <E1wDaiK-001M3A-0W@gemulon.postgresql.org> (raw)

Reject invalid databases in pg_get_database_ddl()

An invalid database has datconnlimit set to -2.  pg_get_database_ddl()
emits this verbatim as CONNECTION LIMIT = -2, which ALTER DATABASE
rejects.  Error out early instead.

Reported-by: Lakshmi N <lakshmin.jhs@gmail.com>
Author: Lakshmi N <lakshmin.jhs@gmail.com>
Reviewed-by: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Euler Taveira <euler@eulerto.com>
Reviewed-by: Hu Xunqi <huxunqi.08@gmail.com>
Discussion: https://postgr.es/m/CA+3i_M8m1k2gFch+tU0JmAQh9FRV+pFrfTXDrJo+BqmwsTmOhg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cda0c4c5d6f581cddaa24cde02c583d1c8f5521d

Modified Files
--------------
src/backend/utils/adt/ddlutils.c | 10 ++++++++++
1 file changed, 10 insertions(+)



Message-ID: <E1wDaiK-001M3A-0W@gemulon.postgresql.org>
Permalink:  ../E1wDaiK-001M3A-0W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wDaiK-001M3A-0W@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: amitlan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Reject invalid databases in pg_get_database_ddl()
  In-Reply-To: <E1wDaiK-001M3A-0W@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox