Is this a bug ? - Mailing list pgsql-general

From Ravi Krishna
Subject Is this a bug ?
Date
Msg-id 6048315C-CE0E-482F-9F48-B300E4D7AC52@aol.com
Whole thread Raw
Responses Re: Is this a bug ?
Re: Is this a bug ?
Re: Is this a bug ?
List pgsql-general
We noticed this bug in Redshift. It then occurred to me that this may
very well be a PG bug since Redshift is based on PG.

Reproduced it in Version 11.5

create table bugtest (fld1 char(1)) ;

insert into bugtest values('a');
insert into bugtest values('b');
insert into bugtest values('c');
insert into bugtest values('d');
insert into bugtest values('e');

select count(*) from bugtest where fld1 in ('a','b','c',
                                            'd','e');  -> produces 5 as output.
So far so good.

Now check this:

select count(*) from bugtest where fld1 in ('a','b','c'
                                            'd','e');

Note the missing comma after 'c'.

PG takes it a syntactically right SQL and gives 3 as output.

In SQLServer it errors out SQL Error [102] [S0001]: Incorrect syntax near 'd'.

Can't believe this bug was never found before.  We ended up wasting lot of time to figure this out.




pgsql-general by date:

Previous
From: Alexander Farber
Date:
Subject: Re: Calling jsonb_array_elements 4 times in the same query
Next
From: Chris Morris
Date:
Subject: Re: Lookup Primary Key of Foreign Server's Table