On Fri, Jan 23, 2004 at 15:01:15 +0000,
LIANHE SHAO <lshao2@jhmi.edu> wrote:
> Hello,
>
> In my query:
> select * from experimentinfo where expid='1';
> here data type of expid is int.
> My question is:
> if I change expid ='xyz', error is: pg_atoi: error
> in "xyz": can't parse "xyz"
> if I change expid ='', error is: pg_atoi:
> zero-length string
>
> In mysql, seems this will not happen and will give
> you 0 row result. but not error message.
If you want to shoot yourself in the foot go use mysql.
>
> So, How can I avoid these annoying message?
You can either have your application handle obviously bogus data or
you can write a function in postgres that converts text to int using
whatever rules you want for assigning values to nonnumeric strings.