Click to See Complete Forum and Search --> : General Disussion on Datatype validation !!


piyushnewe
May 16th, 2006, 07:12 AM
Hi,

lets say,

BIGINT datatype supports range from -9223372036854775808 to 9223372036854775807.

Consider the following scenario

create table Score ( id BIGINT );

insert into Score(id) values ( 18446744073709551615 );

This statement should throw an error but the value gets inserted in most of the databases. When you actually selects the records from that table it is showing the maximum supported value by BIGINT i.e. 9223372036854775807.

Any specific reason for not throwing an error?

-Piyush

DanielaTm
May 19th, 2006, 09:41 AM
Like in many programming languages, your value was truncated.
Maybe this will help:
http://www.postgresql.org/docs/7.3/interactive/datatype.html