Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHbMp-0008W7-WA for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Jan 2023 02:06:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHbMo-0006hk-Im for pgsql-hackers@arkaria.postgresql.org; Tue, 17 Jan 2023 02:06:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHbMo-0006ha-7w for pgsql-hackers@lists.postgresql.org; Tue, 17 Jan 2023 02:06:26 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pHbMl-0006iI-GT for pgsql-hackers@postgresql.org; Tue, 17 Jan 2023 02:06:25 +0000 Received: by mail-lf1-x12b.google.com with SMTP id a11so4979661lfg.0 for ; Mon, 16 Jan 2023 18:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=RDI5qhP0i3DaDR42v+o8yZrpQUWYVBTZ/uL3nqvOocE=; b=LPJDOyNqWzwbElcA/HfEvivZ6+BT/pzfDo0mURKs46Hig7j3gRf5dnskxynFaBHPDv X7hXkjQN+teVIuff452qgWPq4MpyFkM5KhwaSV+LjqK/mSOJ9BDHJMrJvUXX8WiMM/o0 fWThViGwS5EKdLxeBeVdTyuSYpRrvm9Mx+5Pi8kdmWdjCUwV+GUON9WJY1N3C+Gf4ymn M0ZToRMOKS3cu8lCilxLNVAOLzmNu3DM/aWELS+lmfLwPv+1aVCZRNpCfSvy0O1O7hg4 ybgNJZRl0WbYgHeQlsazEg72lGTlVHYiCCbwDSTp3kJ3mOA9HbHTMIJwlc3IdDFAeNed qFow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=RDI5qhP0i3DaDR42v+o8yZrpQUWYVBTZ/uL3nqvOocE=; b=UGh/SgCpPCRj0Oj7Xn/nGksWH40bGgbjogVE5zBVEpnO4N6j7auzu+zBv7QTL5QS0y mDo2mmUR3ord6S1ARMwtIMLI+1u39mfjgTIQfNzWcquQzcYXPjbCAJYc3t+MgH6Rv5dt WRwTUSL0sxOt4tKxPvkdOT5IIXukBdXENLlCODLUkO9yxU7sLAQDplYZ6LF2T3Lw6pSl grCC2hG7vk5kpFTPfTrZXNeYdNXa/IrF7BPOeAmAiq91aYNsk9mwOma7W7WuCXm7Prio t1w9rz0URyA4i9Amjf6nDHa0LOEdDzszPg1442aqy6Ylb+Twe2JQvSjYhNLtJ9pa5hbg 6fOQ== X-Gm-Message-State: AFqh2kpfpOsyjfZB9U9dKDTYaH0IcnKFBYi0cQWXSI+aU2b6HaJZntGw oNlfaYawQ/JQi7z9REHkZkHOFHi/clGjFjkc2IU= X-Google-Smtp-Source: AMrXdXsYdxtkhkz7DWtipuYtXin/PskGebStOu5zdZyk1/m/HE0KR8Ekm1ZpJxg9yDjQyzXt6syc+FhbC/d6iVmMDUY= X-Received: by 2002:ac2:46f3:0:b0:4a2:48c1:455f with SMTP id q19-20020ac246f3000000b004a248c1455fmr55995lfo.96.1673921181818; Mon, 16 Jan 2023 18:06:21 -0800 (PST) MIME-Version: 1.0 References: <20230116223728.GA2714038@nathanxps13> In-Reply-To: <20230116223728.GA2714038@nathanxps13> From: Robert Haas Date: Mon, 16 Jan 2023 21:06:10 -0500 Message-ID: Subject: Re: almost-super-user problems that we haven't fixed yet To: Nathan Bossart Cc: "pgsql-hackers@postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 16, 2023 at 5:37 PM Nathan Bossart wrote: > On Mon, Jan 16, 2023 at 02:29:56PM -0500, Robert Haas wrote: > > 4. You can reserve a small number of connections for the superuser > > with superuser_reserved_connections, but there's no way to do a > > similar thing for any other user. As mentioned above, a CREATEROLE > > user could set connection limits for every created role such that the > > sum of those limits is less than max_connections by some margin, but > > that restricts each of those roles individually, not all of them in > > the aggregate. Maybe we could address this by inventing a new GUC > > reserved_connections and a predefined role > > pg_use_reserved_connections. > > I've written something like this before, and I'd be happy to put together a > patch if there is interest. Cool. I had been thinking of coding it up myself, but you doing it works, too. -- Robert Haas EDB: http://www.enterprisedb.com