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 1ne3B5-0005c9-9Y for pgsql-general@arkaria.postgresql.org; Mon, 11 Apr 2022 23:10:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ne3B4-0004tb-3J for pgsql-general@arkaria.postgresql.org; Mon, 11 Apr 2022 23:10:34 +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 1ne3B3-0004tR-LI for pgsql-general@lists.postgresql.org; Mon, 11 Apr 2022 23:10:33 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ne3B0-0006e9-LI for pgsql-general@lists.postgresql.org; Mon, 11 Apr 2022 23:10:32 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d15so15143532pll.10 for ; Mon, 11 Apr 2022 16:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:content-language:to:from :subject; bh=xKdRB5COl7n4+T+9OgYcJDGiFuvVmH04gjP7MqFlvTc=; b=TIHnGqz0NB0OtdbBQF29zjfYp1gZ0gCCGgIir9dSGYCRW4Wvc0EYfvo008n9iu1iAN 2dEhMA1+H6Nj9mu/LFFnGeJzvnG1lURYGnL2PUwHCoIHitgaEjFMPxAUF2kSNmIPoWVX 7q/+sp1SKYAllOQ+1LEEunSnNZbphnxje8TdanLNLq96EfT8sGpqAcb+E2UfvDRrCyI3 CZVhMIzGFkVb6HVVhQyCoNBrjLOT+tRtC00117f9+OM56+yByT3AM5HUbxuE5IgjPViw REffOcna4D9IPQhFhm85730HgoD3G87jsrJtEG28pk6wsBTjyjqXz8GAw3639A+V6JFL TMcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:from:subject; bh=xKdRB5COl7n4+T+9OgYcJDGiFuvVmH04gjP7MqFlvTc=; b=7wNi2BpLxlJBKr/FMXLAN4GEWLt4UP54RcOLfJpU+ugs+2TlSzvQg9Hh6f1lkbwtqo TimzakHimRU/9T1ElhUplZL1eypGHeEcH4ZT6X/UVlDlj/x4bRBGP9hfL3QUiaJhbe6W ZwOEk/6JAXdqXCiTsH285P8Of+gqTtZF3ETIukTx5bmX+OaVBIlZqLyjKynZV2gS0gO1 knOVKs4YvAKuXtjBLABRmsVvGhI9qJ+mE1efD6QpEB9+5qGsI54esaQ67y1jwGn3hsIk /v4TpFeAEYqsBpwMH06Y1BOF8ZPwB7aukzTxQ6p809oGIULHQHxmUBc0jyk08mgJdYiA PVcQ== X-Gm-Message-State: AOAM530pd4NFJdvZFq1QXCPR4qZppilTsEMUcGkm4zcBEaomlJDdxO8f jfhp26SGQvYOR83Nvjc8ujpAJh+Droc= X-Google-Smtp-Source: ABdhPJxhXt529WbqVmHILtscQTW8vqT7KFoi/RLief6fbxUvOVtcdiW5pZ2UrcBlJ8gGe00G7DJaKw== X-Received: by 2002:a17:902:c94d:b0:158:4e50:7a32 with SMTP id i13-20020a170902c94d00b001584e507a32mr10643587pla.163.1649718629262; Mon, 11 Apr 2022 16:10:29 -0700 (PDT) Received: from [10.128.71.194] ([155.98.131.2]) by smtp.gmail.com with ESMTPSA id i22-20020aa787d6000000b005058be0ff6csm12039682pfo.5.2022.04.11.16.10.27 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Apr 2022 16:10:28 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------LM7D6mE5yupfrGdcoFCEJ1xu" Message-ID: Date: Mon, 11 Apr 2022 17:10:27 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: en-CA To: "pgsql-generallists.postgresql.org" From: Rob Sargent Subject: How easy is it to lose permissions in 'public' schema? List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------LM7D6mE5yupfrGdcoFCEJ1xu Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit I'm using postgres 14 in a database recently brought over from postgres 10.  (I did not do the bringing over.) In my set-up, I partition datasets by schema, create a role per schema and part of that is this explicit permission granting (from superuser): p\g grant all on all tables in schema base, bulk, sgstemplate to sgstemplate\p\g --where sgstemplate is sedded to the real deal by the installer there is no explicit 'public' in that set-up and here-to-fore the new grantee has been able to see into public stuff just fine, in particular to public functions which rely on getting grantee's version of tables (replicated in sister schema). I've just bumped into this. barnard=> select public.genome_threshold_mono('a'::text,'b'::text); ERROR:  permission denied for schema public LINE 1: select public.genome_threshold_mono('a'::text,'b'::text); I know I haven't intentionally removed 'public' from grantee's purview and short of the code block above not actually getting run, any guesses as to how access to 'public' got removed from grantee? I've run those grants specifically naming public and all is well. Do I need to add that to the installer script? --------------LM7D6mE5yupfrGdcoFCEJ1xu Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit I'm using postgres 14 in a database recently brought over from postgres 10.  (I did not do the bringing over.)

In my set-up, I partition datasets by schema, create a role per schema and part of that is this explicit permission granting (from superuser):
p\g
grant all on all tables in schema base, bulk, sgstemplate to sgstemplate\p\g
--where sgstemplate is sedded to the real deal by the installer
there is no explicit 'public' in that set-up and here-to-fore the new grantee has been able to see into public stuff just fine, in particular to public functions which rely on getting grantee's version of tables (replicated in sister schema).

I've just bumped into this.
barnard=> select public.genome_threshold_mono('a'::text,'b'::text);
ERROR:  permission denied for schema public
LINE 1: select public.genome_threshold_mono('a'::text,'b'::text);
I know I haven't intentionally removed 'public' from grantee's purview and short of the code block above not actually getting run, any guesses as to how access to 'public' got removed from grantee?


I've run those grants specifically naming public and all is well.  Do I need to add that to the installer script?






--------------LM7D6mE5yupfrGdcoFCEJ1xu--