While we have a function created, we have not yet applied it as a trigger to the table. Let us do that here as follows:
CREATE TRIGGER popgeom_insert
BEFORE INSERT ON chp02.xwhyzed1
FOR EACH ROW EXECUTE PROCEDURE chp02.before_insertXYZ();
Let's assume that the general geometry column update has not taken place yet, then the original five registers still have their geometry column in null. Now, once the trigger has been activated, any inserts into our table should be populated with new geometry records. Let us do a test insert using the following query:
INSERT INTO chp02.xwhyzed1 (x, y, z)
VALUES (random()*5, random()*7, 106),
(random()*5, random()*7, 107),
(random()*5, random()*7, 108),
(random()*5, random()*7, 109),
(random()*5, random()*7, 110);
Check the rows to verify that the geom columns are updated with the command:
SELECT * FROM chp02.xwhyzed1;
Or use pgAdmin:

After applying the general update, then all the registers will have a value on their geom column:
