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 1suVE5-007FrM-KL for pgsql-general@arkaria.postgresql.org; Sat, 28 Sep 2024 11:03:02 +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 1suVE4-006dR8-GL for pgsql-general@arkaria.postgresql.org; Sat, 28 Sep 2024 11:03:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1suVE3-006dLH-VO for pgsql-general@lists.postgresql.org; Sat, 28 Sep 2024 11:02:59 +0000 Received: from mail-yw1-x112c.google.com ([2607:f8b0:4864:20::112c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1suVE1-001T7k-9k for pgsql-general@lists.postgresql.org; Sat, 28 Sep 2024 11:02:58 +0000 Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-6e1f48e7c18so25779977b3.3 for ; Sat, 28 Sep 2024 04:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727521376; x=1728126176; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=7GWZOiwFVr5OLVsxN2HrDji+kos9lKNNlhKzWOfNzKo=; b=E3FTtFCEWRjrujfgNFz2sgH1MHHJKVdq0ikOoEW0rq1d1KaN0El01aQMy0ibbz6V+T GWiKh8nY8wMth/0qanF9r5nIh9HYl9DWIloVr06MNToNBdcCuVdmd83KcD7Cj8M+WLdh M5sICqQl8c9BEMxsC0C4qkgaMs59jdpl3Cvo3z8UiqDZHxA/oxbDBeLHMj0m4ykCKizT jJwOcX5OvyoQQQsNsafrBfO6m3RUspquONPuCX/JIdRKArvVIjZYWIEP3IAdXMHVrCAA QEclWoJ/73nxHn9Vl2GQRWWkKoRQqUStefeFmVB+99FvsQN18Ux2sE9bdIo99TG4JgF+ Mv+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727521376; x=1728126176; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7GWZOiwFVr5OLVsxN2HrDji+kos9lKNNlhKzWOfNzKo=; b=NSebj0KaY3meobwRMdrQh0gx+CQbGRyHiN86iwaOMw/bPnEPZ/VRIeJpvFbJrDYFKQ sDga81QW8eggz3SLlPj8um0ACGykQwdcqxo22y4cPaSB+jwjLAwakbdvHgMm4OEfi53n LI3KYxssSb8tpKL8dXvglqhBTEQrASptm5JafUz5yJ8jnkWCIEzrS5SNQtNpOuXcTVLp X8bKX/pmX1F1hWWrVMCKgE0TFkMywZM01vVQTHIXOqz4GD/ZMBmMb7Qg/eG18Y8/qLYt y27yNaYTuYIOFqnq7CREZkXmSt76L+fKnMMNDcJojYihT9/x6pFRS8oCWolcYzu4VnAa GDuA== X-Gm-Message-State: AOJu0YyaYu48u3lPYeqLUIf5q4uosVd6giUpeGobPsfFblJfIIP6igBg oFZOPavQvI3tN6ko4DoipCYzDK0mtx+AGgs8C/YeUY6KEp6vGwX2RVAzPaQs41pkufiYXzBClQJ qgHqPsKG39lM1wk+o+LT1CsFnw9Nw2Rh4 X-Google-Smtp-Source: AGHT+IFfR5sSiN+2ZddEbCh8yHBa4HIh2qM0FVvFDQTiAl2Pqp2W/ROvQONcu6IplVCsQWN4Iyu51+kTRdMGq4wc9T8= X-Received: by 2002:a05:690c:2e90:b0:6db:b900:20d9 with SMTP id 00721157ae682-6e247596dbbmr42970487b3.26.1727521376420; Sat, 28 Sep 2024 04:02:56 -0700 (PDT) MIME-Version: 1.0 From: Lok P Date: Sat, 28 Sep 2024 16:32:44 +0530 Message-ID: Subject: Grants not working on partitions To: pgsql-general Content-Type: multipart/alternative; boundary="000000000000fbcd4606232be905" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000fbcd4606232be905 Content-Type: text/plain; charset="UTF-8" Hi, While we are creating any new tables, we used to give SELECT privilege on the newly created tables using the below command. But we are seeing now , in case of partitioned tables even if we had given the privileges in the same fashion, the user is not able to query specific partitions but only the table. Commands like "select * from schema1. " are erroring out with the "insufficient privilege" error , even if the partition belongs to the same table. Grant SELECT ON to ; Grant was seen as a one time command which needed while creating the table and then subsequent partition creation for that table was handled by the pg_partman extension. But that extension is not creating or copying any grants on the table to the users. We were expecting , once the base table is given a grant , all the inherited partitions will be automatically applied to those grants. but it seems it's not working that way. So is there any other way to handle this situation? In other databases(say like Oracle) we use to create standard "roles"(Read_role, Write_role etc..) and then provide grants to the user through those roles. And the objects were given direct grants to those roles. Similarly here in postgres we were granting "read" or "write" privileges on objects to the roles and letting the users login to the database using those roles and thus getting all the read/write privileges assigned to those roles. Are we doing anything wrong? Regards Lok --000000000000fbcd4606232be905 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,
While we are creating any new tables, we used to g= ive SELECT privilege on the newly created tables using the below command. B= ut we are seeing now , in case of partitioned tables even if we had given t= he privileges in the same fashion, the user is not able to query specific p= artitions but only the table. Commands like "select * from schema1.<= ;partition_name> " are erroring out with the "insufficient pri= vilege" error , even if the partition belongs to the same table.
<= br>Grant SELECT ON <table_name> to <user_name>;

Grant wa= s seen as a one time command which needed while creating the table and then= subsequent partition creation for that table was handled by the pg_partman= extension. But that extension is not creating or copying any grants on the= table to the users. We were expecting , once the base table is given a gra= nt , all the inherited partitions will be automatically applied to those gr= ants. but it seems it's not working that way. So is there any other way= to handle this situation?

In other databases(say like Oracle) we us= e to create standard "roles"(Read_role, Write_role etc..) and the= n provide grants to the user through those roles. And the objects were give= n direct grants to those roles. Similarly here in postgres we were granting= "read" or "write" privileges on objects to the roles a= nd letting the users login to the database using those roles and thus getti= ng all the read/write privileges assigned to those roles. Are we doing anyt= hing wrong?

Regards
Lok
--000000000000fbcd4606232be905--