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 1mKhSf-0001wo-MX for pgsql-novice@arkaria.postgresql.org; Mon, 30 Aug 2021 13:36:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mKhSc-0002eX-NN for pgsql-novice@arkaria.postgresql.org; Mon, 30 Aug 2021 13:36:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKhSc-0002eP-F2 for pgsql-novice@lists.postgresql.org; Mon, 30 Aug 2021 13:36:26 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKhSW-0008Ff-Ib for pgsql-novice@postgresql.org; Mon, 30 Aug 2021 13:36:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=EovUqwWAzyPrfZVuWQylE4VPGNwHpAAYfe+DftAM5Qw=; b=sigyggUPLG2aFeMlGt6sX7gsHU VqzGnRd1XIVpteajmjlzP5g3KE8PCtTJPpd9FyCpp/ReOlfl+KJZutKU/rIOUKpiOKC31M8WPn8zb 2BMjh9xfFPkRXH7mJ+oJMkdnHnn+U5sDsRIqvvvYanGL8df8X48j3VzR7bkyqeFxsFMw=; Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by depesz.com with esmtpa (Exim 4.92) (envelope-from ) id 1mKhST-00033Z-MP; Mon, 30 Aug 2021 15:36:17 +0200 Date: Mon, 30 Aug 2021 15:36:17 +0200 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Roger Mason Cc: pgsql-novice Subject: Re: trigger fails Message-ID: <20210830133617.GA9900@depesz.com> Reply-To: depesz@depesz.com References: <20210830081718.GA8307@depesz.com> <20210830120948.GA19692@depesz.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Aug 30, 2021 at 11:03:33AM -0230, Roger Mason wrote: > Hello again, > > hubert depesz lubaczewski writes: > > > it's better to reply to mailing list, unless it's a secret, as others > > can comment and possibly provide answer. > > > > In any case, after running your queries, I got: > > > > ERROR: relation "results" does not exist > > > > This was on test script line 78, which was: > > > > CREATE TRIGGER trigger_f_energy_insert AFTER INSERT ON results FOR EACH ROW > > EXECUTE PROCEDURE trigger_f_energy_insert (); > > > > So, can't test it, sorry. > > This should be sufficient: > > create table results (timestamp text,jid text,machine text,info_out > text); Now your script fails with: ERROR: column results.totenergy_out does not exist If you want help, please, pretty please with cherry on top - make *usable* test script. Write it, test by psql -f ..., and then send if it: 1. works 2. shows the problem Best regards, depesz