Skip site navigation (1) Skip section navigation (2)

Re: pg_atoi error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: LIANHE SHAO <lshao2(at)jhmi(dot)edu>
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_atoi error
Date: 2004-01-23 17:59:15
Message-ID: 27963.1074880755@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
LIANHE SHAO <lshao2(at)jhmi(dot)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

In response to

Responses

pgsql-novice by date

Next:From: Aarni RuuhimäkiDate: 2004-01-23 18:12:42
Subject: Re: 7.4.1 template1
Previous:From: Bruno Wolff IIIDate: 2004-01-23 17:57:05
Subject: Re: pg_atoi error

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group