Convert timestamp column values to epoch in PostgreSQL select query
<p>I need to convert timestamp values to epoch in a <code>SELECT</code> query.
Please find the below sample table and expected result.</p>

<p>Sample table:</p>

<pre><code>select * from log;
</code></pre>

<pre class="lang-none prettyprint-override"><code>id        | 3
time      | 2016-03-30 18:44:19.189513
data1     | NONE
data3     | NONE
data4     | NONE
</code></pre>

<p>Expected result:</p>

<pre class="lang-none prettyprint-override"><code>id        | 3
time      | 1459343659
data1     | NONE
data3     | NONE
data4     | NONE
</code></pre>

<p>Log table is having n number of rows. Please find the below version details:</p>

<pre class="lang-none prettyprint-override"><code>select version();

version                                            
----------------------------------------------------------------------------------------------
 PostgreSQL 9.3.5 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.7.2-5) 4.7.2, 64-bit
</code></pre>