1

I am trying to update one field as epoch from now() but I am getting as '15872897243629.2188' fraction format. What I need is the exact epoch from now() without fraction values like '15872897243629'

here the query I used

UPDATE tablename SET 
column1= extract(epoch from now()),
column2= extract(epoch from now())
where column3= 'SUCCESS';
1

1 Answer 1

3

Add an appropriate type cast:

CAST (EXTRACT (epoch from current_timestamp) AS bigint)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.