Re: BUG #14394: No error raised in IN-clause when commas are missing - Mailing list pgsql-bugs

From Erik Rijkers
Subject Re: BUG #14394: No error raised in IN-clause when commas are missing
Date
Msg-id 757c799204a29dbd3dafc33e0bbffe5a@xs4all.nl
Whole thread Raw
In response to BUG #14394: No error raised in IN-clause when commas are missing  (andreas.imboden@bl.ch)
List pgsql-bugs
On 2016-10-24 16:28, andreas.imboden@bl.ch wrote:
> The following bug has been logged on the website:
>
> Bug reference:      14394

> -- not correct, result = 3
> -- no comma after 'two', no error message, incorrect result
> select sum(cvalue) from abug
>  where cname in (
>     'one',
>     'two'
>     'three',
>     'four',
>     'five');
>



This is actually the correct result because

      'two'
      'three'

will be concatenated to 'twothree', which is isn't present
(leaving 'one', 'four', and 'five' as the 3 that SUM counted).


See also:

select
      'two'
      'three' ;

  ?column?
----------
  twothree
(1 row)


which is, I believe, as described in the SQL standard.


Erik Rijkers

pgsql-bugs by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: BUG #14394: No error raised in IN-clause when commas are missing
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #14394: No error raised in IN-clause when commas are missing