Re: trigger fails - Mailing list pgsql-novice

From David G. Johnston
Subject Re: trigger fails
Date
Msg-id CAKFQuwZt-hZj8_p4=hcZ5tWAYw1ZMwkiDiDNTtznmsASYpuZig@mail.gmail.com
Whole thread Raw
In response to trigger fails  (Roger Mason <rmason@mun.ca>)
List pgsql-novice
On Saturday, August 28, 2021, Roger Mason <rmason@mun.ca> wrote:

I have tried various modifications of get_final_energy without success.

If get_final_energy() isn’t working as you expect (and its definition is highly suspect so I wouldn’t be surprised) then all of this talk about triggers is just adding unnecessary distraction.  Don’t add triggers to the mix until you know the components are all functioning correctly.

I’d also suggest not doing create table if not exists in a trigger.  Whatever code you use to install the triggers should create the table immediately and then the trigger just assumes it is present.

As for debugging the big query, you just need to learn by doing.  Start writing it again from scratch and when you get to a point where it provide unusual results stop and figure out why.

David J.

pgsql-novice by date:

Previous
From: Roger Mason
Date:
Subject: trigger fails
Next
From: "David G. Johnston"
Date:
Subject: Re: trigger fails