Oooh, I'd be so happy to. But I don't know. Yes, I don't know.But postgres 7 rejects this with "ERROR: cannot cast type character varying to integer".As a general rule, you need to be more specific than that about which version you are working with ;-) You may find that username::text::integer will work, depending on which 7.x this actually is. regards, tom lane