Bug in parser?

From: Gerhard Dieringer <Gerhard(dot)Dieringer(at)arcor(dot)de>
To: Postgres Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Bug in parser?
Date: 2003-05-31 20:16:24
Message-ID: 1054412185.28866.0.camel@lise
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Gerhard Dieringer
Your email address : Gerhard(dot)Dieringer(at)nexgo(dot)de

System Configuration
---------------------
Architecture (example: Intel Pentium) :Dual Intel Pentium II

Operating System (example: Linux 2.0.26 ELF) : Linux 2.2.16

PostgreSQL version (example: PostgreSQL-7.3.3): PostgreSQL-7.3.3

Compiler used (example: gcc 2.95.2) : gcc-Version 3.3

Please enter a FULL description of your problem:
------------------------------------------------
Inconsistent results when calling '+' operator with text arguemts
The last 4 results (f.e. '1' + '2' -> 'c') are very strange.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------
select 1 + '2' as result;
result
--------
3
(1 row)

select 1 + '2.3' as result;
psql:error.sql:2: ERROR: pg_atoi: error in "2.3": can't parse ".3"
select 1.5 + '2' as result;
result
--------
3.5
(1 row)

select 1.4 + '2.3' as result;
result
--------
3.7
(1 row)

select '1' + '2' as result;
result
--------
c
(1 row)

select '1' + '2.3' as result;
result
--------
c
(1 row)

select '1.5' + '2' as result;
result
--------
c
(1 row)

select '1.4' + '2.3' as result;
result
--------
c
(1 row)

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------
Sorry :-((

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dave E Martin XXIII 2003-05-31 22:56:56 Re: Index speeds up one row table (why)?
Previous Message Tom Lane 2003-05-31 16:13:12 Re: db growing out of proportion