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 1mKNPu-0004wK-LV for pgsql-novice@arkaria.postgresql.org; Sun, 29 Aug 2021 16:12:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mKNPt-0000qT-JY for pgsql-novice@arkaria.postgresql.org; Sun, 29 Aug 2021 16:12:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKJvG-0002Cs-PW for pgsql-novice@lists.postgresql.org; Sun, 29 Aug 2021 12:28:26 +0000 Received: from esa02.ucs.mun.ca ([134.153.136.22]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKJv7-0002Uo-HV for pgsql-novice@postgresql.org; Sun, 29 Aug 2021 12:28:24 +0000 IronPort-SDR: f9gI61s1JLXo6/v0ccN3tZO2rebvW84AHcd2gX26BM6IWgMDUgx07SF288r2IZ20+CW3YwwkOC sNBC6ZROULP/d6VDQTbGtbWfp9GXU3rLYAMe9772InlgOfLYzkn/PpI/xCWneT9Wi75FVy8wwt A1aEtghYf3twlHRe6Mt102tznR+nEDSYMAtnNyks5JCzHCf/grlRYgKdJ7bTwwybrpPUsUfPg9 OoiXMUhazs1+gRR6dON94j4BVDnncNzPgGsLuFhAmVQuC/GOr1g1k0IMEWrJxMzpd5Yr0MteOI Mf8= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AGQRc+Ks8kwgyTbTJ2P9ccXNZ7skDctV00z?= =?us-ascii?q?EX/kB9WHVpm62j5qKTdZsgtCMc5Ax9ZFgBnpSaNLCEUTfA8/dOj7X5Xo3SPz?= =?us-ascii?q?UO2lHJEGgK1+KL/9SjIUbDH4VmupuIHZITNPTNF1Rgyc717A6keuxL/OW6?= X-IronPort-AV: E=Sophos;i="5.84,361,1620700200"; d="scan'208";a="65737535" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from cpe00fc8db7a323-cm00fc8db7a320.cpe.net.cable.rogers.com (HELO pyrope.local) ([174.117.202.255]) by smtp02.ucs.mun.ca with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2021 09:58:12 -0330 References: User-agent: mu4e 1.5.6; emacs 27.2 From: Roger Mason To: pgsql-novice Subject: Re: trigger fails In-reply-to: Date: Sun, 29 Aug 2021 09:58:09 -0230 Message-ID: MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, David G. Johnston writes: > On Sat, Aug 28, 2021 at 7:04 AM Roger Mason wrote: > >> >> get_final_energy (NEW.jid); >> >> > If you want to use this function within a trigger it should be redefined to > accept "NEW" (i.e., the table record itself), not the jid column (IOW, > don't perform a select on the table during the middle of the trigger > execution). I have not been able to get this to work: the trigger runs and the trigger function is called but no new data are inserted into the target table. Having spent several days on this without result it is time to give up. Thanks again for your help. Roger