I need to convert timestamp values to epoch in a SELECT query.
Please find the below sample table and expected result.
Sample table:
select * from log;
id | 3
time | 2016-03-30 18:44:19.189513
data1 | NONE
data3 | NONE
data4 | NONE
Expected result:
id | 3
time | 1459343659
data1 | NONE
data3 | NONE
data4 | NONE
Log table is having n number of rows. Please find the below version details:
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