Open nathanael-ruf opened 5 months ago
int is 4 bytes in mssql: https://learn.microsoft.com/en-us/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql?view=sql-server-ver16 bigserial is 8 bytes: https://www.postgresql.org/docs/current/datatype-numeric.html
int
bigserial
Expected: pgloader converts to serial (4 bytes).
serial
Besides just more space this has implications for node applications using the pg library which returns strings instead of numbers because numbers in js can't represent full 64bit integers.
pg
number
Location in the code: https://github.com/dimitri/pgloader/blob/29afa9de0563b25bf2da3a9b2d84e2b1b25de098/src/sources/mssql/mssql-cast-rules.lisp#L15-L16
(related: #1586. I only found this issue after applying the fix of #1586 on a fork)
int
is 4 bytes in mssql: https://learn.microsoft.com/en-us/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql?view=sql-server-ver16bigserial
is 8 bytes: https://www.postgresql.org/docs/current/datatype-numeric.htmlExpected: pgloader converts to
serial
(4 bytes).Besides just more space this has implications for node applications using the
pg
library which returns strings instead ofnumber
s because numbers in js can't represent full 64bit integers.Location in the code: https://github.com/dimitri/pgloader/blob/29afa9de0563b25bf2da3a9b2d84e2b1b25de098/src/sources/mssql/mssql-cast-rules.lisp#L15-L16
(related: #1586. I only found this issue after applying the fix of #1586 on a fork)