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 1pjGkR-0007Gf-9P for pgsql-general@arkaria.postgresql.org; Mon, 03 Apr 2023 09:45:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pjGkQ-0002I5-6q for pgsql-general@arkaria.postgresql.org; Mon, 03 Apr 2023 09:45:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pjGkP-0002Hv-SJ for pgsql-general@lists.postgresql.org; Mon, 03 Apr 2023 09:45:09 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pjGkI-000beQ-JZ for pgsql-general@postgresql.org; Mon, 03 Apr 2023 09:45:09 +0000 Received: by mail-ed1-x529.google.com with SMTP id ek18so114851325edb.6 for ; Mon, 03 Apr 2023 02:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; t=1680515101; 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=g5Yt4U4sxHuwt5o8QkIK7OkM2OpCCCU58K2iymYkSqg=; b=nhEsrLBuQbV7mC5Wsi2XqzxUykAdPoCETjGcUk9wC64iJICP/O0EzLsr1QyTKknRCQ Yd8gIxiWA+cdH8sfsWLfU12hgp6Hjt8LPPlhxdFAcoRKS8QvCtHC94aVmqrBM/7ciRvP wcgfSe43wf/AalfHBBKkdWRm5OR9SdQYkiDiAcntImbzXAZgpBWGrRhD1SSFaUw/TQlx h+QsrN/LDnRdueznJU7jyWeu7RLYhFosJ+XXQTIpJatb4k4FEg1SNXA+QMTfuBzdwCKB oC67tEfysqjUu4A0q2rcb2iMa9ZCGA95xisnVHyvYLk2HPZoJLhTpMgBR4KnCrnszY4z i4cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680515101; 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=g5Yt4U4sxHuwt5o8QkIK7OkM2OpCCCU58K2iymYkSqg=; b=eDyv29Wpiq7HrYdJqWavoC13SUyqtK8lY5rQiKB29dT8noXSVtKC3NeVUYShxFtRw1 T5UZnS7WeAFT+MSxyGiASjvD1HXl92lRKbuRCc0i5p1GN4bop/y0kbC4ea4oWFs8FQMr yYn+c80unghEHNY5MYr5tQFWk0sHr/E1Uu8kspwuZvyLzOgEhPfAEx8wFikezTg8ebk2 V4XReQ9KZJVkmsqFWB5trukur8DYRCEJvhUoMdKCkyPTP30ar/AVB7Jd89+69HsRprq6 8BDCKh1ESXXTIfS7uCWXlEMULUqLFeLwvAXUx6JdCXOBWJVG03b/xrqmVYni2LigXiNZ +1cA== X-Gm-Message-State: AAQBX9ekhMor9nmdjzJG1HRwSeTRPJFtE9eX6UMyDt7+NmI2mZERTxQi lo3pV/wpt/7sfZQXcBh4I+usxA== X-Google-Smtp-Source: AKy350bs0HrSAU5zHSbM/SW5pToaJpu0erRC8Z+ZzUCjkGTfWK6MKFwQ8gJ3t8GMocvSz3148K4+Eg== X-Received: by 2002:a17:907:86ac:b0:92b:eefb:b966 with SMTP id qa44-20020a17090786ac00b0092beefbb966mr46649663ejc.0.1680515101250; Mon, 03 Apr 2023 02:45:01 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:6aca:140f:2a2:608:8640]) by smtp.gmail.com with ESMTPSA id o18-20020a17090608d200b0092973e209f2sm4313678eje.109.2023.04.03.02.45.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Apr 2023 02:45:01 -0700 (PDT) Message-ID: <5aec0a43c2e3d4c7be2d010b0e0684253cdb1f1e.camel@cybertec.at> Subject: Re: PostgreSQL From: Laurenz Albe To: Joseph Kennedy Cc: Stephen Frost , Giovanni Biscontini , pgsql-general@postgresql.org Date: Mon, 03 Apr 2023 11:45:00 +0200 In-Reply-To: References: <2eef5146f9836742de02d9db5cbe6cc8a4e3827d.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 2023-04-02 at 23:21 +0200, Joseph Kennedy wrote: > I have one more question on this topic regarding Row Level Security.=20 >=20 > I would like to hide some rows for users who should have full rights to d= atabase > eg. create Index, drop table, create tabel etc. but e.g.=C2=A0 create ind= ex can be > done by owner or superusers but they are bypassed by Row Level Security.= =20 >=20 > Is possible to use RLS for users who should have full rights to database = ? If "full rights" implies dropping tables, the user must either be the owner of these tables or a superuser. You cannot use Row Level Security with a superuser. You can use ALTER TABLE ... FORCE ROW LEVEL SECURITY, so that Row Level Security applies to the table owner as well, but you cannot keep the owner from disabling that setting. Yours, Laurenz Albe