I need to deal with the, I suppose the big int, primary key values 1380742793415240.
In R I can easily adjust option(scipen=100) but I need to store that data in postgres db.
I've already tried to dbWriteTable default (double precision) with result: violate constaint (probably duplicate keys in ...4e+015 representation) and also after changing target column to bigint with result: invalid input syntax for integer: "1.38074279341524e+015".
example: try to save and load from db following dt
sample_dt <- data.table(a = c(20130101,20130102,20130102),
b = c(1380742793415240,1380742793415241,1380742793415242))
What is the effective way of save and load this kind of data in postgres?
options' and I'm wondering ifoptions(scipen=100)is really doing what you think it is.).Machine$integer.max < 1380742793415240 [1] TRUEsql <- paste0("select * from tbl where b >= '",one_id,"'")effectively. Not all the IDs are are starting with 138..., to handle that case I would need to fill the leading spaces with zeros to have all the strings the same nchar. Isn't there any more elegant solution to store numbers like212982,1380742793415240as the primary key column and query them effectively using>operator???