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 1iYIpW-0007AF-3K for pgsql-general@arkaria.postgresql.org; Fri, 22 Nov 2019 23:59:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iYIpU-0002Be-I1 for pgsql-general@arkaria.postgresql.org; Fri, 22 Nov 2019 23:59:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iYIpS-0002BX-ID for pgsql-general@lists.postgresql.org; Fri, 22 Nov 2019 23:59:12 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iYIpM-0003Yh-JX for pgsql-general@lists.postgresql.org; Fri, 22 Nov 2019 23:59:10 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 6207EECE; Fri, 22 Nov 2019 18:59:01 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 22 Nov 2019 18:59:01 -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=fm1; bh=Q bNITiRFvvTLO3sI1g4OLsdBcg/zhsupqp4tNkLIWyc=; b=RuqxlAfuJv/jdwcXB R5l0E39p3hwcjoEQ/eLamQYLOboDYPWIpOMl4m04A2HeHsQ20DsLiqd/HHb6A7qM fjt2SLPLzKJ4h98jTuxng9AhblhZxFxggMQZJfrSbAFlKDPtVFn5eKqqihWZDPnK Q5YFLAQSMGa1pLndHU/9ChLsRZ0YZvI1voy0Yr7+u3+UAsVZgsWn0bO0MoffgddQ N5myDgU2C4NBS4S/wpWAxIK6OJXY7tOULtcIIAQVWmrm9ffsa7F+ktERd2cG7rKV /GRpH0bWfj7Blp/GiAtr8/sxIT87sjt8JyRLAYwNwvZViXDukUCiV3fmNna9asy0 WNafg== 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=fm1; bh=QbNITiRFvvTLO3sI1g4OLsdBcg/zhsupqp4tNkLIW yc=; b=VOVDcEoaYQvsTawTB8VJ2C07X6wKpZMWCrJQJ2oQdjaiENppU89uiYAp/ Ntoc0zVKSNlFpoCLNiH3HqS9LtxjuMYHPOM68YYgSPuyYC1ZXreuHRIZBCay1Prw 2bgWQmY894vrn/tUmiNt4/GBRgJdwyna5w7GLIowZdQK/VvnJOjGLFA7Lk0ElXTc 3CqVeTZepyWjDnsrj44JAN+CuObeo74aHg+sLnr2HnwBqgxPKQtr745p/nsXPMF7 r+bzLL63dF3qmdZAhDPaJjwgDSYEK1C/+87XDu2BDQcMShC3K8CubBHDRHHyH6g6 f5sE81PpIofnFXJjqi+jeL3IRG4GQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudehhedgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecukfhppeejuddrvdduvddrudeffedrud dukeenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghk lhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.2] (unknown [71.212.133.118]) by mail.messagingengine.com (Postfix) with ESMTPA id 4845D8005C; Fri, 22 Nov 2019 18:59:00 -0500 (EST) Subject: Re: And I thought I had this solved. To: stan , pgsql-general@lists.postgresql.org References: <20191122235216.GA7008@panix.com> From: Adrian Klaver Message-ID: <3763f66e-c200-2f7b-31fe-8709c07f314a@aklaver.com> Date: Fri, 22 Nov 2019 15:58:59 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20191122235216.GA7008@panix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/22/19 3:52 PM, stan wrote: > A while back I ran into problems caused by security fix related to the > search path. I wound up adding a line to. for instance, this function: > > REATE FUNCTION > work_hours > ( > start_date date, > end_date date > ) > RETURNS decimal(10,4) stable > language sql as $$ > > /* workaround for secuirty "feature" */ > SET search_path TO ica, "user" , public; > > SELECT > sum(case when > extract(isodow from d) > between 1 and 5 then > 8.0 else > +0.0 end) > from > > generate_series($1, > $2, interval > '24 hours') d; > > $$; > > And walked away happy, or so I thought. Now I just got this error: > > [local] stan@stan=# select * from ttl_avail_hours_by_project_and_employee ; > ERROR: SET is not allowed in a non-volatile function > CONTEXT: SQL function "work_hours" during startup > > How can I solve this issue? If the above is the entire function I am not seeing that you need to SET search_path as there is no object that needs schema qualification. I would comment it out and run it. If that fails then set the function volatile. -- Adrian Klaver adrian.klaver@aklaver.com