Select a set of integer from postgres

Currently I need to return a list of integers from a select query from postgresql. I tried array (integer[]) but it didn’t look good. So, I found that we can return a type called setof.

This is the detailed post:

https://wiki.postgresql.org/wiki/Return_more_than_one_row_of_data_from_PL/pgSQL_functions

 

It’s awesome!