On Tue, Aug 7, 2018 at 12:09 PM, Day, David <dday@redcom.com> wrote:
EXECUTE format(' UPDATE admin.user SET (%I) = ( SELECT %I FROM $1 ) WHERE id = $2)', USER_SETTING, USER_SETTING ) USING NEW, NEW.id;
When this executes my exception handler generates "err syntax error at or near \"$1\"
The value after FROM must be an identifier and so cannot be parameterized. You have to use "%I" for that dynamic element as well - only $2 (which becomes $1) is valid to parameterize (though you could just do "%L" and drop the USING clause on the EXECUTE...)