PostgreSQL - Advanced PL/pgSQL
What will happen when the following PL/pgSQL block is executed?
DECLARE
col_name text := 'salary';
total numeric;
BEGIN
EXECUTE 'SELECT sum(' || col_name || ') FROM employees' INTO total;
RAISE NOTICE 'Total salary: %', total;
END;