From: Tom Lane <tgl@sss.pgh.pa.us>
To: omkar1103@gmail.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #12242: No error - if there is no comma seperator
Date: Mon, 15 Dec 2014 20:15:38 -0500
Message-ID: <6851.1418692538@sss.pgh.pa.us> (raw)
In-Reply-To: <20141215162555.2699.79394@wrigleys.postgresql.org>
References: <20141215162555.2699.79394@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
omkar1103@gmail.com writes:
> Below script does not throw error
> =======================================
> SELECT
> claim_status,
> claim_key
> FROM tbl_claim
> WHERE claim_key IN
> (
> '1140799265'
> '2129945595'
> )
> Throws Error
> =======================================
> SELECT
> claim_status,
> claim_key
> FROM tbl_claim
> WHERE claim_key IN
> (
> '1140799265' '2129945595'
> )
Yup. This is not only not a bug, it's behavior required by the SQL
standard. Literal strings are concatenated automatically as long as
they're separated by a newline. This is mentioned in the PG docs
under 4.1.2.1. String Constants:
http://www.postgresql.org/docs/9.3/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS
(This is one of many decisions I'm sure the SQL committee would like
to have back, but we're pretty much stuck with it now.)
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, omkar1103@gmail.com
Subject: Re: BUG #12242: No error - if there is no comma seperator
In-Reply-To: <6851.1418692538@sss.pgh.pa.us>
References: <20141215162555.2699.79394@wrigleys.postgresql.org> <6851.1418692538@sss.pgh.pa.us>
* 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