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 1i7J0K-0007lj-4N for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2019 12:42:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i7J0I-0004dJ-OQ for pgsql-general@arkaria.postgresql.org; Mon, 09 Sep 2019 12:42:46 +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 1i7J0I-0004PQ-8v for pgsql-general@lists.postgresql.org; Mon, 09 Sep 2019 12:42:46 +0000 Received: from n3.nabble.com ([162.255.23.22]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1i7J0F-0001C7-6m for pgsql-general@postgresql.org; Mon, 09 Sep 2019 12:42:44 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 9A1701704347B for ; Mon, 9 Sep 2019 05:42:41 -0700 (MST) Date: Mon, 9 Sep 2019 05:42:41 -0700 (MST) From: Jim Finnerty To: pgsql-general@postgresql.org Message-ID: <1568032961628-0.post@n3.nabble.com> In-Reply-To: References: <1567906652523-0.post@n3.nabble.com> <24375.1567970828@sss.pgh.pa.us> Subject: Re: Whan is it safe to mark a function PARALLEL SAFE? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk The scenario is a STABLE function that calls out to an AWS service that charges micro pennies per row, so periodically inserting CHECK_FOR_INTERRUPTS() should be able to prevent charges from accumulating for a statement that has already failed in another parallel worker. I think it's safe to declare such functions as PARALLEL SAFE. Thank you! ----- Jim Finnerty, AWS, Amazon Aurora PostgreSQL -- Sent from: https://www.postgresql-archive.org/PostgreSQL-general-f1843780.html