pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Is this a bug ?
Date: Wed, 23 Oct 2019 10:55:35 -0500
Message-ID: <9df3ba0d-974d-f13d-ec91-bc22c3ab362b@gmail.com> (raw)
In-Reply-To: <CAEzk6fdPCjF0HkbL_8NMRQHKR2k_sRNCAc67jeqBQMO0hTU3xQ@mail.gmail.com>
References: <6048315C-CE0E-482F-9F48-B300E4D7AC52@aol.com>
	<CAEzk6fdPCjF0HkbL_8NMRQHKR2k_sRNCAc67jeqBQMO0hTU3xQ@mail.gmail.com>

On 10/23/19 10:51 AM, Geoff Winkless wrote:
> On Wed, 23 Oct 2019 at 16:42, Ravi Krishna <sr_krishna@aol.com> wrote:
>
>> 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.
> Simplify:
>
> select 'a'
> db-# 'b';
>   ?column?
> ----------
>   ab
> (1 row)
>
> This is not a bug.
>
> https://www.postgresql.org/docs/9.2/sql-syntax-lexical.html
>
> Two string constants that are only separated by whitespace with at
> least one newline are concatenated and effectively treated as if the
> string had been written as one constant.

Then -- since the 'e' is separated from 'd' by a comma, the result should be 
"4", not "3".

No doubt: it's a bug, no matter what the Pg devs say.

-- 
Angular momentum makes the world go 'round.





view thread (35+ messages)  latest in thread

Message-ID: <9df3ba0d-974d-f13d-ec91-bc22c3ab362b@gmail.com>
Permalink:  ../9df3ba0d-974d-f13d-ec91-bc22c3ab362b@gmail.com/
Also on:    postgresql.org/message-id/9df3ba0d-974d-f13d-ec91-bc22c3ab362b@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: Is this a bug ?
  In-Reply-To: <9df3ba0d-974d-f13d-ec91-bc22c3ab362b@gmail.com>
  References: <6048315C-CE0E-482F-9F48-B300E4D7AC52@aol.com> <CAEzk6fdPCjF0HkbL_8NMRQHKR2k_sRNCAc67jeqBQMO0hTU3xQ@mail.gmail.com> <9df3ba0d-974d-f13d-ec91-bc22c3ab362b@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox