Re: pg_atoi error

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg_atoi error
Дата
Msg-id 27963.1074880755@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg_atoi error  (LIANHE SHAO <lshao2@jhmi.edu>)
Ответы Re: pg_atoi error  (george young <gry@ll.mit.edu>)
Список 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 по дате отправления:

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: pg_atoi error
Следующее
От: Aarni Ruuhimäki
Дата:
Сообщение: Re: 7.4.1 template1