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 1o7QFd-0006z2-B4 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Jul 2022 23:40:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o7QFb-0000f2-K5 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Jul 2022 23:40:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7QFb-0000en-9K for pgsql-hackers@lists.postgresql.org; Fri, 01 Jul 2022 23:40:39 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7QFT-0000pD-0O for pgsql-hackers@postgresql.org; Fri, 01 Jul 2022 23:40:37 +0000 Received: by mail-pg1-x535.google.com with SMTP id r66so3761294pgr.2 for ; Fri, 01 Jul 2022 16:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=KWlWU1jp0SOOVljNUJbvZlrrC+KHhtHs57KpjS2eSFs=; b=dw8e9qzdOf1cSe8k0tMNPoZXnCt36+SRGqgmNexhK5BKmpzl2j+UIs44UPVrfMXn/w jzooTU9LO4XICsr66gwdoVUNW2J8BMwrTNudo4Z7pfgRUeopYrtitgTeqVGwPgIyXyaR Uhd1v12QRXZ/0Xfw8KvDgmJhW74dBeCdz6iZBQ7oy1LnqSUCvroJKgWglzMP7TDvUWRf f/4fTUGP+wjL8EaxSU5i0Oau2h8F8F1/qGhFUvk4p392y0cUds/OQyIIGM7eULZ0u23e JwTh8ULmRLeXVO0E6XHT40M83y45uPtYpM3S5nQaJL0G+zyvTI76ofx5+NhKTxLmg0yL Ni5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KWlWU1jp0SOOVljNUJbvZlrrC+KHhtHs57KpjS2eSFs=; b=VC9e3KaMNwJH0HcufCXiod0/Fi2qWGAYvUcBfBo20JYAgxkPNuURuo9xzNxKZZTsxl QsleO+uqWHYD4J6QiqARXS8A0pAzq9auwVh7Y/IHWWE8MiQ4KnjQx8oGGADrzrUPZykf kzGABPou/l3yWRqdeB0NgoX6URoY4/rvtG3KFkFsRSvbgGu8Ja7e4dHVFgbCS4TqKzaO zqiXGEgRXD/II8F4P/uDqTuYwBxXK/aGSlFkdxsr9CKq+Uve+HFHSMmA4AleoRN98z0M FLweZlAgchvBhwjIwFP9JyXKDxP1ZSLWYSRascpI7xev0OqMm57kVaw+IeplElBDZhBB LhuA== X-Gm-Message-State: AJIora+IliL/QPgqureIglzaX+uJ5O968KjEWdrG3jmT7YciLMKJUKeo 8Q/FzLMX0F+tcVfN804q6NM= X-Google-Smtp-Source: AGRyM1vBpcnd+kuA0MIoStKU2rS5yZLcl+yonFuL05VHgaFWU1fgxB1lo0Wo9IqlMFLG8cMJmMfpBA== X-Received: by 2002:a05:6a00:c91:b0:525:8c3f:269 with SMTP id a17-20020a056a000c9100b005258c3f0269mr23873240pfv.66.1656718829903; Fri, 01 Jul 2022 16:40:29 -0700 (PDT) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id m9-20020a63fd49000000b00408c592db61sm16005020pgj.71.2022.07.01.16.40.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 16:40:28 -0700 (PDT) Date: Fri, 1 Jul 2022 16:40:27 -0700 From: Nathan Bossart To: Steve Chavez Cc: pgsql-hackers@postgresql.org Subject: Re: Allow placeholders in ALTER ROLE w/o superuser Message-ID: <20220701234027.GA637814@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 Sun, Jun 05, 2022 at 11:20:38PM -0500, Steve Chavez wrote: > However, defining placeholders at the role level require superuser: > > alter role myrole set my.username to 'tomas'; > ERROR: permission denied to set parameter "my.username" > > Which is inconsistent and surprising behavior. I think it doesn't make > sense since you can already set them at the session or transaction > level(SET LOCAL my.username = 'tomas'). Enabling this would allow sidecar > services to store metadata scoped to its pertaining role. > > I've attached a patch that removes this restriction. From my testing, this > doesn't affect permission checking when an extension defines its custom GUC > variables. > > DefineCustomStringVariable("my.custom", NULL, NULL, &my_custom, NULL, > PGC_SUSET, ..); > > Using PGC_SUSET or PGC_SIGHUP will fail accordingly. Also no tests fail > when doing "make installcheck". IIUC you are basically proposing to revert a6dcd19 [0], but it is not clear to me why that is safe. Am I missing something? [0] https://www.postgresql.org/message-id/flat/4090.1258042387%40sss.pgh.pa.us -- Nathan Bossart Amazon Web Services: https://aws.amazon.com