title: Dynamic column in SELECT statement postgres
body: <p>I am quite new to the postgresql.</p>
  
  <p>what is the best way to achieve this?</p>
  
  <pre><code>SELECT get_columns() 
    FROM table_name;
  </code></pre>
  
  <p><code>get_columns()</code> will provide the column names for the query. I saw people advising to use EXECUTE statement but I couldn't got that working.</p>
  
  <p>Lets say there is table Test with columns a,b,c 
  and I want to run </p>
  
  <pre><code>SELECT a,b FROM Test;
  SELECT a,c FROM Test;
  </code></pre>
  
  <p>with column names generated dynamically.</p>