Possible bug in parsing

From: Hannu Krosing <hannu(at)trust(dot)ee>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Possible bug in parsing
Date: 1998-03-17 11:28:53
Message-ID: 350E5E75.325F4A24@sid.trust.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Can anyone explain the following:

hannu=> select 1 + 2 + 3 + 4;
?column?
--------
10
(1 row)

works fine, but:

hannu=> select '1' || '2' || '3';
ERROR: parser: parse error at or near "||"
hannu=> select ('1' || '2') || '3';
NOTICE: there is more than one operator || for types
NOTICE: unknown and unknown. You will have to retype this query
ERROR: using an explicit cast
hannu=> select ('1'::text || '2') || '3';
?column?
--------
123
(1 row)

I understand the 'there is more than one operator' errors, but
what is so different between operators + and || ?

Hannu

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pedro J. Lobo 1998-03-17 12:06:59 Unix Domain Sockets error (was Re: [HACKERS] Alpha initdb fixed!)
Previous Message Andrew Martin 1998-03-17 10:50:32 Re: [HACKERS] First mega-patch...