Try this
explain SELECT id FROM it_test WHERE
id='123';
QUERY PLAN ---------------------------------------------------------------------------- Index Scan using it_test_pkey on it_test (cost=0.00..4.82 rows=1 width=8) Index Cond: (id = 123::bigint) (2 rows) The point is that 123 is naturally considered by Postgres to
be an int4. If you want to specify it is an int8 then use quotes around your
value or an explicit cast if the sought value is some kind of int4, int2
attribute.
The same apply for smallints.
|
Title: Message
- [BUGS] Bugs in bigint indexes Gustavo Scotti
- Re: [BUGS] Bugs in bigint indexes Peter Eisentraut
- Re: [BUGS] Bugs in bigint indexes Nishad Prakash
- Re: [BUGS] Bugs in bigint indexes Tom Lane
- jmm