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 1pHY6p-0000Ab-9x for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Jan 2023 22:37:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHY6n-0002Uz-Pg for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Jan 2023 22:37:41 +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 1pHY6n-0002QK-Dh for pgsql-hackers@lists.postgresql.org; Mon, 16 Jan 2023 22:37:41 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pHY6g-0004vr-9Z for pgsql-hackers@postgresql.org; Mon, 16 Jan 2023 22:37:40 +0000 Received: by mail-pj1-x1030.google.com with SMTP id o13so26964880pjg.2 for ; Mon, 16 Jan 2023 14:37:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pCT8ffLjXOy+vPI2wUSqV7POXgrnRk5SLdP8BdPcLNQ=; b=ErZd36g98L7UU5pHYZxgk9cVERj5EPnyEwt3UmFneXSGv8SX/v0AkoaxzBHmd5obh+ XD5Ft+EWhMabWumAa1gLSR9w+AxfWKwmSQux80OHzUwzBejkDFRpvhaBF2jgZVj/kiK/ nnr7a5a3fRWve1g49Y8DrxV4b4dEufwVVbZQjg9CyHTAu8pfAzHUTOTc5TrJI31pGdtw vd2sIIoQomkET+H4El/BTBnM1fPfbQKI3YARzuQ5WJZaCMBPGw5XgWve/J8opALNTZwP jQ1TlFBQV+/VnmcMs1QrV7kD4YD/+wsHtJf98EJcKlsbHzyh7Dg7t6UCzX6mxORUIK11 HiWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pCT8ffLjXOy+vPI2wUSqV7POXgrnRk5SLdP8BdPcLNQ=; b=IHsE5xkqFM/GFR4vm/ttthQGqgskhgFQnrSGdKdM0NAuDXKlBEFeOB+N4bzW2ZhdT6 etZLtR8JkqGUuADRHvkABUDdlhxjXnositUjkkH3lecaCZA9/2uBbaT+fGsLPineVpmX qEjMIfebec1AoWIdkv7Ojb5BEHihKrZFJBskXlx5G7o0IyMEBBUZjxlSyMIDSQL74r2t 9RHXeSwUDZz4cQF/Mqi25bR5CWHQZ+TahGp9Ue7Zs4Ih8ItteL6qBvmNfOiQoutC5c9L qYLYIAHpcWY8ZdAbfm4a/WxcWnx8MRIgVi08IlTNCSxlWQq8AoZ+KXA3/0Sae1Z+W7SH 3UtQ== X-Gm-Message-State: AFqh2kpJB9ncz3eJ8ynMUtDfbE6XI4Wxaj38WME/2EucYfG1TVa+BQVS x8avIXwuezYqAPMuRk2j1AI= X-Google-Smtp-Source: AMrXdXvDb/XYiwly1Pz0V+EBLMq7rzl0Qf2SrpuTI5bAv0YOxyfQURmCUU5dF64/S2PhgxfuyMV7Sw== X-Received: by 2002:a05:6a20:6f62:b0:b2:48e8:e3a9 with SMTP id gu34-20020a056a206f6200b000b248e8e3a9mr190484pzb.12.1673908650814; Mon, 16 Jan 2023 14:37:30 -0800 (PST) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id 1-20020a620601000000b005814aafa224sm18552052pfg.196.2023.01.16.14.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 14:37:30 -0800 (PST) Date: Mon, 16 Jan 2023 14:37:28 -0800 From: Nathan Bossart To: Robert Haas Cc: "pgsql-hackers@postgresql.org" Subject: Re: almost-super-user problems that we haven't fixed yet Message-ID: <20230116223728.GA2714038@nathanxps13> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com