I am quite new to the postgresql.
what is the best way to achieve this?
SELECT get_columns() FROM table_name;
get_columns(
In such case I would use PL/pgSQL function using cursor.