In Oracle we have a function where we are using bulk collect to fetch data and store in a variable like.
SELECT DISTINCT emp_id
BULK COLLECT INTO v_emp_array
FROM emp_details;
where v_emp_array is a type:
Oracle: CREATE OR REPLACE TYPE v_emp_array IS TABLE OF VARCHAR2(4000);
Please help to get this functionality in PostgreSQL.
Being new to these, I am not able to find the correct syntax for it.