Re: FW: [JDBC] BIGINT vs Java's long
От | Stephan Szabo |
---|---|
Тема | Re: FW: [JDBC] BIGINT vs Java's long |
Дата | |
Msg-id | Pine.BSF.4.21.0108071122390.34686-200000@megazone23.bigpanda.com обсуждение исходный текст |
Ответ на | FW: [JDBC] BIGINT vs Java's long ("Dave Cramer" <dave@fastcrypt.com>) |
Ответы |
Re: FW: [JDBC] BIGINT vs Java's long
|
Список | pgsql-hackers |
On Tue, 7 Aug 2001, Dave Cramer wrote: > This came into the jdbc list > > Apparently bigint is not really 8 bytes??? > > I test this out with psql > > test=# create table testbigint (id serial, fp0 int8); > NOTICE: CREATE TABLE will create implicit sequence 'testbigint_id_seq' > for SERIAL column 'testbigint.id' > NOTICE: CREATE TABLE/UNIQUE will create implicit index > 'testbigint_id_key' for table 'testbigint' > CREATE > test=# insert into testbigint (fp0) values (1); > INSERT 333698 1 > test=# update testbigint set fp0 = -9223372036854775808 where id = 1; > ERROR: int8 value out of range: "-9223372036854775808" Yes, it's failing on precisely the minimum value. It appears that the code that does this sets the sign and then makes the number and applies the sign at the end which would be wrong in this case (as it overflows on 9223372036854775808) I don't think my patch against recent sources would apply cleanly to older ones, and I didn't run the regression against it, but it seemed to work, and is only a two line change in current source.
В списке pgsql-hackers по дате отправления: