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 1fUbZP-0008Lm-00 for pgsql-general@arkaria.postgresql.org; Sun, 17 Jun 2018 17:34:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fUbZN-0003Zo-LL for pgsql-general@arkaria.postgresql.org; Sun, 17 Jun 2018 17:34:29 +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 1fUbZN-0003Zd-Db for pgsql-general@lists.postgresql.org; Sun, 17 Jun 2018 17:34:29 +0000 Received: from wolff.to ([98.103.208.27]) by magus.postgresql.org with smtp (Exim 4.89) (envelope-from ) id 1fUbZG-00024s-7A for pgsql-general@postgresql.org; Sun, 17 Jun 2018 17:34:28 +0000 Received: (qmail 9388 invoked by uid 500); 17 Jun 2018 17:31:51 -0000 Date: Sun, 17 Jun 2018 12:31:51 -0500 From: Bruno Wolff III To: pgsql-general@postgresql.org Subject: Re: Trying to understand odd trigger behavior Message-ID: <20180617173151.GA9320@wolff.to> Mail-Followup-To: Bruno Wolff III , pgsql-general@postgresql.org References: <20180615040424.GA18759@wolff.to> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20180615040424.GA18759@wolff.to> User-Agent: Mutt/1.10.0 (2018-05-17) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Jun 14, 2018 at 23:04:24 -0500, Bruno Wolff III wrote: > >I have a perl after insert trigger for a table with a non-null column >element and I am getting an occasional error when the trigger executes >for printing a null value which is $TD->{new}{element}. However, I do >the insert with an on conflict that converts it into an update. And I >have a before update trigger that blocks changing the record, but >returns null if the old and new records are the same. I think I misunderstood the error I was getting. I don't think the value being printed is null, but rather the socket instance I am trying to print to. I haven't tested this yet, but it makes sense and my other theory didn't match later evidence.