Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srih8-003zYy-OS for pgsql-general@arkaria.postgresql.org; Fri, 20 Sep 2024 18:49:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1srih6-00BnUv-LD for pgsql-general@arkaria.postgresql.org; Fri, 20 Sep 2024 18:49:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1srih6-00BnUk-7p for pgsql-general@lists.postgresql.org; Fri, 20 Sep 2024 18:49:29 +0000 Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1srih3-000ERc-AE for pgsql-general@postgresql.org; Fri, 20 Sep 2024 18:49:28 +0000 Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-5365cf5de24so3095341e87.1 for ; Fri, 20 Sep 2024 11:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726858165; x=1727462965; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=W1TPQQSHPdUgjNanEeG/wyLlVvCAvNs0Lj9opYBUgpE=; b=EATnAF2pQ+LKFcZBh0fbda7NSZw7nmJZzeNMQWvHgT2QAfN18s4x59EdhsAejBPw3Z LizyJUFw+7ITPreg1s946bNguyd82d5btiEM2S9tjZigsoD9uknQ5a3KSX4eWzQTlgIV Ak+UBIM6DvYtJH8hN6T3V/dS2aItydlji81b3Vr4y69JlZDXQ+VUF7b/FawjIErVQnrL xmNksfwIJqYHOVYcZ4JdxL1O3xc4qi3DlSTkAIQ8GXr6FYjmriB7XLJfQTkWUTL07ofS Htuf6KBPBY8sZ8Y9/L6AP2j0rWtyfc2wj5qYED7M7f4TEJtZzRePYsssts+/nVUgO885 72dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726858165; x=1727462965; h=content-transfer-encoding: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=W1TPQQSHPdUgjNanEeG/wyLlVvCAvNs0Lj9opYBUgpE=; b=KJGf1MUBbsu9BoqUU1/Ca6myheuEziqfWoFhg2dkhP5Zf1epw1ROQbBGVgmNvD4T6G /v9evz4h/BbbnU1YxaG9tT6odDAu0IWmr1V+mz26mFIKfTVlIgNqHiw+nvLuXrnpZJ8M +NKoSLperXRM2CymdSzGWXQsERSl0w1Ow9uZYR77FPaZm4nJjm5pOgo8G/4wYyl6nfie 9vOG0AVqKBQmMU5vIrmCtHg/nK3FzU7lRWEBllOwhFpGMoEY8LhMbcQBOvdxyPKimlte Jm5skyXi3R5Pw4KcQyOs0qXL/pq5yXM+NiGBPav7Qko0iaIVPOOZ4C61HyWS137DkDOG 525g== X-Forwarded-Encrypted: i=1; AJvYcCV+R1dA+fpn/U7IH4Bxx/0CkZSNuK7WOl1+mWtmkWyfe9Elet6Gb8Prgr+2wjAyzMMaddCSw+PAJdSf7TNz@postgresql.org X-Gm-Message-State: AOJu0YznNHO06wzGihUXXk7t9DZ3oEvg0PCUzCttTiKv+u8zd4dH/1C5 UuPUYZUcTvq4lJIiCfidl3143N3o0zgePF4ZzWepRD5FV8ILdrIyl0d6Gzj4hgHEw0mpgXWCzGw mxSyi7RcX0LBoKwsZlzl6O0XqlFg= X-Google-Smtp-Source: AGHT+IGXC+UJ7eJ49NN8vZQxKG6dPFdzdrthUbM5qB3C879w0/7uwa+BmoCbb8HlGkCiqFAyYaPHeXhSM/Nwof5waNY= X-Received: by 2002:a05:6512:3088:b0:530:c239:6fad with SMTP id 2adb3069b0e04-536acb29163mr2586132e87.0.1726858165044; Fri, 20 Sep 2024 11:49:25 -0700 (PDT) MIME-Version: 1.0 References: <42cf78d42a376bf05ca9f5776ad29edc30e784d5.camel@cybertec.at> <2468702.1726856198@sss.pgh.pa.us> <2470834.1726857267@sss.pgh.pa.us> In-Reply-To: <2470834.1726857267@sss.pgh.pa.us> From: Robert Haas Date: Fri, 20 Sep 2024 14:49:13 -0400 Message-ID: Subject: Re: Why no pg_has_role(..., 'ADMIN')? To: Tom Lane Cc: Laurenz Albe , Dominique Devienne , pgsql-general@postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 20, 2024 at 2:34=E2=80=AFPM Tom Lane wrote: > I'm now inclined to add wording within the pg_has_role entry, along > the lines of > > WITH ADMIN OPTION or WITH GRANT OPTION can be added to any of > these privilege types to test whether ADMIN privilege is held > (all six spellings test the same thing). I don't have an opinion about the details, but +1 for documenting it somehow. I also think it's weird that we have six spellings that test the same thing, none of which are $SUBJECT. pg_has_role seems a little half-baked to me... --=20 Robert Haas EDB: http://www.enterprisedb.com