Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fv3d9-00066B-4W for pgsql-general@arkaria.postgresql.org; Wed, 29 Aug 2018 16:47:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fv3d5-0001zK-P1 for pgsql-general@arkaria.postgresql.org; Wed, 29 Aug 2018 16:47:39 +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_SHA384:256) (Exim 4.89) (envelope-from ) id 1fv3d5-0001z7-Gk for pgsql-general@lists.postgresql.org; Wed, 29 Aug 2018 16:47:39 +0000 Received: from n3.nabble.com ([162.255.23.22]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fv3d2-00047U-4H for pgsql-general@postgresql.org; Wed, 29 Aug 2018 16:47:38 +0000 Received: from n3.nabble.com (localhost [127.0.0.1]) by n3.nabble.com (Postfix) with ESMTP id 4499AECE7CB6 for ; Wed, 29 Aug 2018 09:47:34 -0700 (MST) Date: Wed, 29 Aug 2018 09:47:34 -0700 (MST) From: TalGloz To: pgsql-general@postgresql.org Message-ID: <1535561254219-0.post@n3.nabble.com> In-Reply-To: References: <1535533938898-0.post@n3.nabble.com> <019001d43f86$11742960$345c7c20$@swisspug.org> <1535541719123-0.post@n3.nabble.com> <019e01d43f91$5f3c4460$1db4cd20$@swisspug.org> <1535560026747-0.post@n3.nabble.com> Subject: Re: Executing a Function with an INSERT INTO command fails 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 > Add "RAISE ERROR" to the top function's BEGIN block and verify that the > next time you run your calling query it indeed fails. I'm suspecting that > the code you are iterating over is not the same code that is being > executed > (search_path dynamics probably). Do you mean like this BEGIN RAISE NOTICE . . INSERT INTO public.runtime_benchmark (test_number, column_names, execution_time, operation_type, seal_or_sql) VALUES (1, 'Pickup_longitude, Dropoff_longitude', '1', 'sub', 'seal'); . . END; If I use RAISE ERROR i get ERROR: unrecognized exception condition "error" Tal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html