With current sources I get: regression=# select 'foo' < 'bar'; ERROR: pg_atoi: error in "foo": can't parse "foo" I was expecting the system to resolve this as a text comparison, but it seems to have chosen int4 instead. This is, um, surprising behavior. regards, tom lane