OK I understood. My INSERT should look like this:
INSERT INTO events (timestamp) VALUES (to_timestamp(TO_CHAR(TO_TIMESTAMP(1401432881222 / 1000), 'YYYY-MM-DD HH24:MI:SS') || '.' || (1401432881222%1000), 'YYYY-MM-DD HH24:MI:SS.MS'))
I convert bigint-timestamp with milliseconds to text with the required format ('YYYY-MM-DD HH24: MI: SS.MS') and pass it to to_timestamp function.
Clyde source share