Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3tYm-0001t9-VI for pgsql-general@arkaria.postgresql.org; Tue, 18 Feb 2020 03:28:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j3tYl-0007CP-NM for pgsql-general@arkaria.postgresql.org; Tue, 18 Feb 2020 03:28:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3tYk-0007CI-Dh for pgsql-general@lists.postgresql.org; Tue, 18 Feb 2020 03:28:31 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j3tYh-0004C2-H2 for pgsql-general@postgresql.org; Tue, 18 Feb 2020 03:28:29 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8C07521448; Mon, 17 Feb 2020 22:28:26 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 17 Feb 2020 22:28:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=4 99RVZdZ+V4LvPEqccqsrU6ifvN3cQddhzOlWlxhAeg=; b=udycvVaMF5nSIQ2Q1 d0hKcwXFuOC/NrAvW+ZhVn9rBP69ehg+s66hpkgCTY6cMsbcpdv4nfLAiczhx9vr /9SI5Rbq2vZuv0hnsX3XGjxEpcC7Zor/XytomIwMSj411K5gB8LrjEtJbDP6ftpZ 9hc9CCo9/B3oxQpi1SWmCTLcaVnLq9vLUkzf5QOQGaixEIo0sIihekf+OM0l0B6K TfW6DPj5Qc8JRfrazf/rMXEUCgFNSSSRn+LG+41QfOH7o43x/9pMzNvft6HRkTzb S2i434FOjFw6UyAFOZzj93i+oOwTlPSKrQD5EI1UfeK+qRPzxYYjvBNm1dRBHsF9 XhVPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=499RVZdZ+V4LvPEqccqsrU6ifvN3cQddhzOlWlxhA eg=; b=A8MKBDBsOO3hJDgFkluMbF+a5j7M1z1FRkogLRYW2kiN5wN5XrZpVtkzh a5CbX6EVCsns1CVAZe82eXoSkN4NxrqUzV7JoAtqGfbn3w/c+6oa0y823wxHIgRD BxSNPFK7P4KgT1aRdYR9EbIynfHD5sYapXUWtcJzS7SEb5wG5WDKSTTgwoGcs2b/ jn74Hw6AXMbIkVZY/kwPH3Z1f1xdvhkcDm92hr6Ve6IckasNvpG7HEG4L6IHKsK9 7Js2JCTLl6cEECEnu/NLqwu8cYEwR09xKlvALc3H5YsLb/NIFJItIJE8nlSkZAgY zveX+3unQ5Gn3lofHbuXcasmW6U2A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjeejgdehkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucfkphepjedurddvuddv rdduvdelrdduleefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id CF43B3280059; Mon, 17 Feb 2020 22:28:25 -0500 (EST) Subject: Re: policies and extensions To: Marc Munro , pgsql-general@postgresql.org References: <1581979568.18009.18.camel@bloodnok.com> From: Adrian Klaver Message-ID: <42b2e01b-8afd-1a3f-be1f-b221d1bae3da@aklaver.com> Date: Mon, 17 Feb 2020 19:28:25 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <1581979568.18009.18.camel@bloodnok.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/17/20 2:46 PM, Marc Munro wrote: > I tried to define a policy within an extension but the policy does not > seem to belong to the extension. Is this the way it is supposed to be? > > This is postgres 9.5.21 > > Here is the relevant code from the extension: > > create table rls2 ( >   username text not null, >   details  text not null > ); > > create policy only_owner on rls2 >   for all >   to session_user >   using (username = user); > > The table, as expected, depends on the extension but the policy does > not (determined by querying pg_depend). > > Am I missing something special about policies or is this an oversight? ?: https://www.postgresql.org/docs/9.5/sql-createpolicy.html "The CREATE POLICY command defines a new row-level security policy for a table. Note that row-level security must be enabled on the table (using ALTER TABLE ... ENABLE ROW LEVEL SECURITY) in order for created policies to be applied." > > __ > Marc > > -- Adrian Klaver adrian.klaver@aklaver.com