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 1sRd06-00HAiV-ND for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jul 2024 19:29:14 +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 1sRd04-008Kz5-T3 for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jul 2024 19:29:12 +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 1sRd04-008Kyx-EV for pgsql-hackers@lists.postgresql.org; Wed, 10 Jul 2024 19:29:12 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sRczx-001RJc-88 for pgsql-hackers@lists.postgresql.org; Wed, 10 Jul 2024 19:29:11 +0000 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-6eab07ae82bso47599a12.3 for ; Wed, 10 Jul 2024 12:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1720639743; x=1721244543; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=pOnjVwOJp3hMT604vg2O4QRQcDJDiv7dugAOaz745y0=; b=bE/Tu3+JqF13tKfZZeEQIj7jFUiRAVqyxydlnu9nqyvSi8y4TQYNsaNGAyZhwNx/Bk iCZYLO7dfQIRdNUpJAZojH7vWuClSkPealKHTVKx62gA/Zwocdmhfo/GZJEps54jY6Ze 6ZeVejkBE/OdlkISx2l9pz79mOTGr1fG6xqz7MZPCslVCB58C0cbg3cOz03e83E65FaJ 8Tfjv+UkjkoY1tidhsKi3a8vTeFL49zUb8E0DY1McYPap2TIK6OsBObOdGi/25RAMHcb xF9FH8l5e0mJeoY45cq0gQKahI5frNYQaaB+05tYXqt7jzXK4rY51HtWSu77eV6RSk8i UxLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720639743; x=1721244543; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pOnjVwOJp3hMT604vg2O4QRQcDJDiv7dugAOaz745y0=; b=V4XkK98ffIbNlpw2qiZHy7JPgPw7DsMdm0bPYVmbEmzVr0aFYGnYt/1S1eGsi46WQ+ jQic6aj/iYwH8nkLTKSB9NvBWoMA4zzy4VJmK28SmRC+Vf4auEBhA4Zvjer3NED1GvPk AqjmqfkmaK/QTIweSYWnq5e+An/XVYeXoRvQqFiMWDXGU3psdkUbKpHq8T9MCBT44MAH Pv1O3nd17P3hrPwanfUAHWNIku/6lqqgKXyhY0IxL1wovScsEcacb1xyAbJkl3iU0ej2 6d8+eq/2FuJ8MQH7b7R8fYB3f2Hy89hSAdI9oKRQwuqNGRBt1XCMZZ7tVadLBXkbl5UM L/tQ== X-Gm-Message-State: AOJu0Ywly68rtqWycSiYnLovpn/GQk63pwvcwqDWFjKogawuPH29gD58 pLw9iedfXJ9CJa5CeqklpCkvraqiE7oi/9GBFtnnPLLMtXewNuIoKyZy4c/i5w== X-Google-Smtp-Source: AGHT+IGMG1Yos6hibnI+C5/rZjRGRF0AUqquMbx8vm62j08vhPeob1YzFMNXILRhKXNE6lGJAJoDbg== X-Received: by 2002:a05:6a21:99a5:b0:1c0:defa:b67d with SMTP id adf61e73a8af0-1c2984cef95mr7487404637.46.1720639742502; Wed, 10 Jul 2024 12:29:02 -0700 (PDT) Received: from jeff-laptop.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-70b4389c0ffsm4298153b3a.16.2024.07.10.12.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jul 2024 12:29:02 -0700 (PDT) Message-ID: <3f4c6e5ce54d8871ab915dc4f5c270a940f628d6.camel@j-davis.com> Subject: Re: pg_maintain and USAGE privilege on schema From: Jeff Davis To: Fujii Masao , Nathan Bossart Cc: PostgreSQL Developers Date: Wed, 10 Jul 2024 12:29:00 -0700 In-Reply-To: References: <56596b81-088f-4c0c-9a88-b5f27a7a62e9@oss.nttdata.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2024-07-10 at 17:13 +0900, Fujii Masao wrote: > ISTM that both > pg_read_all_data and pg_write_all_data roles are defined similarly, > with USAGE rights on all schemas. I'm not so sure that was a great idea to begin with. If you create a private schema with a SECURITY DEFINER function in it, it's a bit odd to allow someone with pg_read_all_data to execute it. Granted, that's documented behavior, but I'm not sure the privileges should be bundled in that fashion. > > It might be reasonable to give implicit USAGE privileges on all > > schemas > > during maintenance commands to pg_maintain roles. That's an even more specific exception: having USAGE only in the context of a maintenance command. I think that's a new concept, right? Regards, Jeff Davis