diff --git a/lib/pg_data_encoder/encode_for_copy.rb b/lib/pg_data_encoder/encode_for_copy.rb index 93de5a9..8555338 100644 --- a/lib/pg_data_encoder/encode_for_copy.rb +++ b/lib/pg_data_encoder/encode_for_copy.rb @@ -171,7 +171,7 @@ def encode_field(io, field, index, depth=0) io.write([hash_io.pos].pack("N")) # assumed identifier for hstore column io.write(hash_io.string) when Time - buf = [(field.to_f * 1_000_000 - POSTGRES_EPOCH_TIME).to_i].pack("L!>") + buf = [(field.to_f * 1_000_000 - POSTGRES_EPOCH_TIME).to_i].pack("Q!>") io.write([buf.bytesize].pack("N")) io.write(buf) when Date