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 1nUYsc-0001xz-UG for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Mar 2022 19:00:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nUYrd-0004et-Ml for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Mar 2022 18:59:17 +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 1nUYrc-0004ej-UO for pgsql-hackers@lists.postgresql.org; Wed, 16 Mar 2022 18:59:17 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nUYrW-0000AE-Sc for pgsql-hackers@postgresql.org; Wed, 16 Mar 2022 18:59:15 +0000 Received: by mail-pj1-x1031.google.com with SMTP id e3so2931911pjm.5 for ; Wed, 16 Mar 2022 11:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vTnE7P4eHBuPm9Y3Gxt8DajUS0YnYWW+xEud797iPX4=; b=dFIOcP3eh5ZxqwZL/uUq7XLyHQmh/LESi3Ji/BCzPHTSd4DXfJHmJztnyGilO1D4Kc 0GUMn/Rujg0nBgrf9t/78zME6UCq1bhswqTS5PdhXQUJ5X3dh+3oEbbBbZkUfPyPKxEY 3HYYRkdysVqySnO81elK1JH99CXrP9syyma0pL3WdarJm9velCXLRPdP5qVp3DUQO+W/ ZmvDA5DbIe6vP7phQ81zBJj+1WAvXckwXRpy8HTzCBCKpLw1MOfwz3mYqKARIL+vQ+sQ P0LmwN2Sor5eo8trsc2QyispcWcR2XFypd6Zjd34SFNnq/yQslSWo2mQvqEPY5hRyrwQ hZzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vTnE7P4eHBuPm9Y3Gxt8DajUS0YnYWW+xEud797iPX4=; b=5BRvAazjahpw4SOSleNOZcoLCqC2lQxcGrNBSV8a203S3gG2dyc0eBqrlY84gBX7ZG rxcmzrwf9cacoFTUWVF9JLrZt3Z2w9Etz3AnkiLHWoS9DOfQWBpcMWJ+ogK6NzbyLrov eG2NxWvhVHkh2QxyG0x2GsBi9pD4+Kj3q9QVz9PXsI1AeAHEtPvIWrXzKOpWLmYLTl2E r60ES76mV/4w6ORK7qMDfm45Yls7d8GovG+XpyXy3V2JWKU7SPN+uCys9M2R16hjSBDV Aplq5F9Gz87P4djkoNvHFhHyRw0uHtIafcG2M+ExY+0OWViqW5kzWjtZMT7ZvJ6Tvfc9 YOFg== X-Gm-Message-State: AOAM533z7RNEUdbPq2Ihb9M4vF9tZYiUsc2gXKp3SzbtZOTsdag3dFv3 0S50+JW3FNDqLBN6r0OWztJoAWjrgrnw7m+gYw0a/PI1Xj7j6hYBAEHtD9fRb+1pmDguZ6ldvrw 2VPkNGFGuVcMcjwxxCVQtvwcnLV4jrMhlwc5hvPRw+nKGEGLQdCrtz0Q3YhSY0i+80B1QExuzG5 ZKmU8ICVzr+m5zeM8rDxnbXRtnCfytPRlyfywh X-Google-Smtp-Source: ABdhPJxzzAox3fCVnMYLXzYpV+yTP3b93RkDJH+8Eirmo7SXbWcEi+pOKrnMfIjeiSZkvE4pFYj57w== X-Received: by 2002:a17:90a:fb4e:b0:1bc:8227:edd9 with SMTP id iq14-20020a17090afb4e00b001bc8227edd9mr1199770pjb.56.1647457149440; Wed, 16 Mar 2022 11:59:09 -0700 (PDT) Received: from laptop280-ma-us.hitronhub.home (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id s12-20020a056a00194c00b004f7c1da7dd5sm4323201pfk.1.2022.03.16.11.59.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2022 11:59:08 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: Granting SET and ALTER SYSTE privileges for GUCs From: Mark Dilger In-Reply-To: <664799.1647456444@sss.pgh.pa.us> Date: Wed, 16 Mar 2022 11:59:06 -0700 Cc: Andrew Dunstan , Joshua Brindle , Robert Haas , Jeff Davis , PostgreSQL-development , Joe Conway Content-Transfer-Encoding: quoted-printable Message-Id: References: <3D691E20-C1D5-4B80-8BA5-6BEB63AF3029@enterprisedb.com> <9DB8DABC-0E1E-4AB0-BB11-9BC48E4C71BE@enterprisedb.com> <2D6C1081-DB7D-4260-8987-5B4912E95917@enterprisedb.com> <1A6DA47B-2D5F-427E-AD72-1D8BD23BF94C@enterprisedb.com> <79685.1646604824@sss.pgh.pa.us> <83814.1646607430@sss.pgh.pa.us> <78889A65-CA7A-4015-866D-33460967071D@enterprisedb.com> <92485.1646609263@sss.pgh.pa.us> <43857434-3f9b-3! 66f-0401-7aea558827e1@dunslane.net> <664799.1647456444@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3608.120.23.2.7) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Mar 16, 2022, at 11:47 AM, Tom Lane wrote: >=20 > Stepping back a bit ... do we really want to institutionalize the > term "setting" for GUC variables? I realize that the view pg_settings > exists, but the documentation generally prefers the term = "configuration > parameters". Where config.sgml uses "setting" as a noun, it's usually > talking about a specific concrete value for a parameter, and you can > argue that the view's name comports with that meaning. But you can't > GRANT a parameter's current value. >=20 > I don't have a better name to offer offhand --- I surely am not = proposing > that we change the syntax to be "GRANT ... ON CONFIGURATION PARAMETER = x", > because that's way too wordy. But now is the time to bikeshed if = we're > gonna bikeshed, or else admit that we're not interested in precise > vocabulary. Informally, we often use "GUC" on this list, but that isn't used = formally, leaving "configuration parameter" and "setting" as the two = obvious choices. I preferred "configuration parameter" originally and = was argued out of it. My take on "setting" was also that it more = naturally refers to the choice of setting, not the thing being set, such = that "work_mem =3D 8192" means the configuration parameter "work_mem" = has the setting "8192". I'm happy to change the patch along these = lines, but I vaguely recall it being Robert who liked the "setting" = language. Robert? (Sorry if I misremember that...) > I'm also fairly allergic to the way that this patch has decided to = assign > multi-word names to privilege types (ie SET VALUE, ALTER SYSTEM). = There > is no existing precedent for that, and I think it's going to break > client-side code that we don't need to break. It's not coincidental = that > this forces weird changes in rules about whitespace in the = has_privilege > functions, for example; and if you think that isn't going to cause > problems I think you are wrong. Perhaps we could just use "SET" and > "ALTER", or "SET" and "SYSTEM"? I chose those particular multi-word names to avoid needing to promote = any keywords. That's been a while ago, and I don't recall exactly where = the shift-reduce or reduce-reduce errors were coming from. I'll play = with it to see what I can find. > I also agree with the upthread criticism that this is abusing the > ObjectPostAlterHook API unreasonably much. In particular, it's > trying to use pg_setting_acl OIDs as identities for GUCs, which > they are not, first because they're unstable and second because > most GUCs won't even have an entry there. I therefore judge the > hook calls added to ExecSetVariableStmt and AlterSystemSetConfigFile > to be 100% useless, in fact probably counterproductive because they > introduce a boatload of worries about whether the right things happen > if the hook errors out or does something guc.c isn't expecting. I think Joshua was planning to use these hooks for security purposes. = The hooks are supposed to check whether the Oid is valid, and if not, = still be able to make choices based on the other information. Joshua, = any comment on this? > I suggest that what might be saner is to consider that the "objects" > that the hook calls are concerned with are the pg_setting_acl entries, > not the underlying GUCs, and thus that the hooks need be invoked only > when creating, destroying or altering those entries. That's certainly a thing we could do, but I got the impression that = Joshua wanted to hook into SET, RESET, and ALTER SYSTEM SET, not merely = into GRANT and REVOKE. > If we do have > a need for a hook editorializing on GUC value settings, that would > have to be an independent API --- but I have heard no calls for > the ability to have such a hook, and I don't think that this patch > is the place to introduce one. Well, the call for it was in this thread, but I'm ok with yanking out = that part of the patch if it seems half-baked. =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company