Assigning a Variable Generic NEW Value by Pressing a Postgres Trigger In the trigger body, how can I get a value of NEW by the field name?

This is what I want to do:

some_key = "some_column";

value := NEW[some_key];
You have to use dynamic SQL like this:

EXECUTE format('SELECT $1.%I', some_key) INTO value USING NEW;