On Fri, Jan 09, 2004 at 04:11:08AM -0600, D. Dante Lorenso wrote: > Sergey Olefir wrote: > > >So the logical choice would be int8, right? Unfortunately quite wrong. > >Statement of the form: "SELECT * FROM table WHERE id=1" > >will never use index for id (assumming id is int8) since '1' is of type > >int4. This is confirmed both by documentation and SQL EXPLAIN (after set > >enable_seqscan TO 'off').
I think you can use WHERE id=cast(1 AS bigint) > Well, that just plain sucks. That means I've gotta go back and > add casts to all my queries? > > Tell me it isn't so! Yeah, it is :-( AFAIU it is fixed in the current development version, but who knows if it will be done in time before you tables grow too big ... -- Alvaro Herrera (<alvherre[a]dcc.uchile.cl>) "Porque francamente, si para saber manejarse a uno mismo hubiera que rendir examen... ¿Quién es el machito que tendría carnet?" (Mafalda) ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings