Reputation: 1189
I have to store upto 3 millisecond digit in timestamp column.
I have two fixed column in each tables: createdDate,LastmodifiedDate.
While inserting data value of CreatedDate/LastmodifiedDate:
now() at time zone 'utc'
But it is storing 5 digit of millisecond.
I would like to store only 3 fractional digit of millisecond.
let me suggest which type of datatype is storing only 3 fractional digit of millisecond.
let me know if you have any solution.
Upvotes: 4
Views: 6688
Reputation: 31666
Postgres allows you to specify precision(0 to 6) while casting to TIMESTAMP
See Docs
So, you could do
select (now() at time zone 'utc') :: timestamp(3)
Upvotes: 8