views:

44

answers:

2

greetings all i want to know what's equivalent to Long data type in postgresql which i can retrieve in a long variable.

+3  A: 

According to the docs it looks like bigint is your friend, with a range of -9223372036854775808 to 9223372036854775807.

Jon Skeet
+1  A: 

Should be a bigint

bigint 8 bytes large-range integer -9223372036854775808 to 9223372036854775807

From here: http://www.postgresql.org/docs/current/interactive/datatype-numeric.html

SQLMenace
you are right but bigint cannot be casted to long, so what is the solution then ?
sword101
@sword101: bigint in postgresql should be extracted from the ResultSet with the getLong() method- not getBigDecimal(). "bigint" isn't a java type, "long" isn't a postgresql type, so what you just said doesn't quite make sense.
araqnid
i am using hibernate ?
sword101