
DROP TRIGGER IF EXISTS worker_insert_update_fio ON akuz.t_worker;
DROP FUNCTION IF EXISTS akuz.worker_fio CASCADE;

UPDATE akuz.T_WORKER t
SET FIO = t.LastName || ' ' || LEFT(t.FirstName, 1) || '.' || 
    CASE 
        WHEN NULLIF(TRIM(BOTH FROM t.FatherName), '') IS NOT NULL THEN LEFT(t.FatherName, 1) || '.'
        ELSE ''
    END;