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 1jiF0z-0004TP-1w for pgsql-general@arkaria.postgresql.org; Mon, 08 Jun 2020 10:28:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jiF0y-00029n-0O for pgsql-general@arkaria.postgresql.org; Mon, 08 Jun 2020 10:28:24 +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 1jiExr-0006hf-IU for pgsql-general@lists.postgresql.org; Mon, 08 Jun 2020 10:25:11 +0000 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jiExp-0008VF-A0 for pgsql-general@lists.postgresql.org; Mon, 08 Jun 2020 10:25:10 +0000 Received: by mail-wr1-x42c.google.com with SMTP id h5so16779870wrc.7 for ; Mon, 08 Jun 2020 03:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qsN107yocbMlhyEMH9Hq8OeOWtpK0n2xuQtPxvjyZC0=; b=WzxlcW+30THuOEGoTn0p1Q9y2flk+UP+heBreTGPurX0b06iZNWjWnsnREeqoi/VBD 3xirculD2g0UnY7ONcyeGGI3W/SzU6jvGURshYJVskkOydRbeYEgXTQw34Pm7XPGRF8Y H7iJO5PSLrv6a4vjeWCkAgw3yVoUXi8qV2NuBJoa77njn1JV9pB5Eh2qGo+7GKu4YYYD NdORSkrVuIl3K9J7SI1e9hkMSYV9nCOwtN7dF4VWaw17oW2+EHduR3E3T+cDVOlaPhmc C1zBndGEg6kCOyF2KRCtWDWziYPmf6EVaOD35JuOlBsXFk2jruRyG8QYr0G4ZObaOlCG lAog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=qsN107yocbMlhyEMH9Hq8OeOWtpK0n2xuQtPxvjyZC0=; b=L9skL72H/0aUR5zOSDCZZ3vjeeAqL41xxk6dfjsznUNMaA3DSpKZ2Wj4950wGfuqZS 7t/uhJoZOf+SBaEXy51/kU2QRiOqq71Am74cJVov48+XQ8zsR89WtChs80scGOHi1+o3 YYy0zjAx/SPZIr2CTQ8mnxWobHBt4vColrHbS39PxK//QtQGbnFvaPd+pkK9zxUfix41 J0SZedQ1tRJHqaCpYw/RdsfQr+lkDX1xpGThq1qy/TB2KUNlBWIKMPL4DUAiDQzKCCV8 Ap1xq6sySDY72AVhk5vljfh/SkxJXcEK+u/Mb2n5u0wNneHbJ+/n4R7xOZA7OAJd72OT oGng== X-Gm-Message-State: AOAM530lLMkq77vpFA4szhu2sTPJuixXUtnnV3I23cAvQ8sFhQ52XShp ZmHN91j3HyeG4I2/RMoLlcg= X-Google-Smtp-Source: ABdhPJz9dDkLyApP4eF316MzbnVZaBkxyuDMHRy7cFxgBD4KsqBIBVY7izmQwN7HiFSq72glwtWdVg== X-Received: by 2002:a05:6000:1202:: with SMTP id e2mr21733572wrx.231.1591611907119; Mon, 08 Jun 2020 03:25:07 -0700 (PDT) Received: from [192.168.1.8] (241-57-239-77.dyn.cable.fcom.ch. [77.239.57.241]) by smtp.gmail.com with ESMTPSA id d63sm5981329wmc.22.2020.06.08.03.25.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jun 2020 03:25:06 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: Postgres 12 RLS From: =?utf-8?Q?Paul_F=C3=B6rster?= In-Reply-To: Date: Mon, 8 Jun 2020 12:25:04 +0200 Cc: postgre Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Laura Smith X-Mailer: Apple Mail (2.3608.80.23.2.2) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Laura, > On 08. Jun, 2020, at 12:17, Laura Smith = $$ LANGUAGE plpgsql SECURITY = DEFINER; you might want to use security invoker instead of definer. = https://www.postgresql.org/docs/current/sql-createfunction.html#SQL-CREATE= FUNCTION-SECURITY = https://www.cybertec-postgresql.com/en/abusing-security-definer-functions/= Cheers, Paul