title: How to create CSV file from SQL?
body: <p>I am wondering how to create or export a CSV file from SQL? Is there any function for that similar to pgsql2shp?
  I would appreciate your ideas, tip or solutions.</p>