Re: Is this a bug ?

From: Geoff Winkless <pgsqladmin(at)geoff(dot)dj>
To: Ravi Krishna <sr_krishna(at)aol(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Is this a bug ?
Date: 2019-10-23 15:51:02
Message-ID: CAEzk6fdPCjF0HkbL_8NMRQHKR2k_sRNCAc67jeqBQMO0hTU3xQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 23 Oct 2019 at 16:42, Ravi Krishna <sr_krishna(at)aol(dot)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.

Geoff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ravi Krishna 2019-10-23 15:53:56 Re: Is this a bug ?
Previous Message Gianni Ceccarelli 2019-10-23 15:48:27 Re: Is this a bug ?