Re: pg_atoi() behavior change? Intentional?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adam Haberlach <adam(at)newsnipple(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_atoi() behavior change? Intentional?
Date: 2001-02-24 21:58:16
Message-ID: 15287.983051896@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Adam Haberlach <adam(at)newsnipple(dot)com> writes:
> ... one of the engineers has been writing some queries that
> cast a text field to an int and take advantage of the
> fact that we used to turn text fields with no digits into 0,
> much as C's atoi function works.

> The new behavior is to throw a parse error, which causes
> all kinds of problem. Is this intentional?

What new behavior?

regression=# select ''::text::int4;
?column?
----------
0
(1 row)

7.0.* behaves the same as far as I can tell. I think this is actually
a bug, and it *should* throw an error ... but it doesn't.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-02-24 22:07:54 Re: offset and limit in update and subselect
Previous Message Bruce Momjian 2001-02-24 21:01:15 Re: A patch for xlog.c