title: How to get day name from weekday number in postgresql?
body: <p>I have a table with the weekday stored as an integer, 0 to 6.</p>
  <p>What function do I need to create the day names relative to these day numbers?</p>
  <p>Eg: 0 -&gt; Sun, 1-&gt;Mon, etc</p>
  <p>Like:</p>
  <pre><code>SELECT magic(my_day_number) FROM my_table;
  Mon
  </code></pre>