Re: pg_atoi error - Mailing list pgsql-novice

From Tom Lane
Subject Re: pg_atoi error
Date
Msg-id 27963.1074880755@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_atoi error  (LIANHE SHAO <lshao2@jhmi.edu>)
Responses Re: pg_atoi error
List pgsql-novice
LIANHE SHAO <lshao2@jhmi.edu> writes:
> Actually I am wondering if pgsql can work on its own
> with garbage data like mysql. for example if it
> should be expid ='1' but I use it with expid='xyz'.
> In this case, MySql will seliently give you 0 row
> instead of error message.

This is a fundamental difference in philosophy between the two projects.
You are wasting your breath trying to convince any Postgres developer
that this aspect of MySQL's behavior is a wise design.  And I'm sure you
would get equally much push-back from the MySQL developers if you tried
to persuade them to tighten their error checking.  If MySQL's philosophy
agrees with your worldview, then you should probably go use MySQL.

Alternatively, you can write your own conversion function that does what
you want, as several people have suggested already.  You can even cause
it to become the default behavior in your installation (just change the
input function for type int4).  But it's not going to become the
standard behavior for Postgres.

            regards, tom lane

pgsql-novice by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: pg_atoi error
Next
From: Aarni Ruuhimäki
Date:
Subject: Re: 7.4.1 template1